File: debug.html

package info (click to toggle)
htmx 4.0.0-alpha6-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 117,328 kB
  • sloc: javascript: 49,403; sh: 29; makefile: 7
file content (113 lines) | stat: -rw-r--r-- 2,770 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="htmx-config" content='{"logAll":true}'>
    <title>htmx 4.0 Tests</title>

    <!-- Mocha CSS -->
    <link rel="stylesheet" href="https://unpkg.com/mocha@11.7.4/mocha.css">

    <style>
        .playground-wrapper {
            max-width: 900px;
            margin: 3rem auto;
            padding: 1.5rem;
            border-radius: 12px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
        }

        .playground-wrapper h3 {
            margin: 0 0 1.5rem 0;
            padding-bottom: 0.75rem;
            border-bottom: 3px solid #4CAF50;
            font-size: 1.5rem;
            font-weight: 600;
        }

        #test-playground {
            padding: 1.5rem;
            border: 2px solid #e0e0e0;
            border-radius: 8px;
            min-height: 100px;
        }

        .header {
            padding: 20px;
            font-family: monospace;
            font-weight: bold;
        }

        .run-all-btn {
            display: inline-block;
            margin: 0 20px 20px 20px;
            padding: 10px 20px;
            background-color: #4CAF50;
            color: white;
            text-decoration: none;
            font-family: sans-serif;
            font-weight: 600;
            font-size: 14px;
            transition: background-color 0.2s;
        }

        .run-all-btn:hover {
            background-color: #45a049;
        }

        .run-all-btn:active {
            background-color: #3d8b40;
        }
    </style>

    <!-- Test infrastructure -->
    <script src="https://unpkg.com/chai@4.5.0/chai.js"></script>
    <script src="https://unpkg.com/mocha@11.7.4/mocha.js"></script>

    <script src="lib/fetch-mock.js"></script>

    <!-- htmx after mocks are set up -->
    <script src="../src/htmx.js"></script>

    <script>
        // Initialize Mocha
        mocha.setup({
            ui: 'bdd',
            fullTrace: true
        });
        window.assert = chai.assert;
        window.should = chai.should();
    </script>

    <!-- Test helpers -->
    <script src="./lib/helpers.js"></script>

    <script src="./tests/attributes/hx-sync.js"></script>

    <script>
        // Run tests on load
        window.addEventListener('load', () => {
            mocha.run();
        });
    </script>

</head>
<body>
<div class="header">
    <h1>htmx 4.0 Test Suite</h1>
</div>

<a href="test.html" class="run-all-btn">Run All</a>

<!-- Mocha test output -->
<div id="mocha"></div>

<!-- Test playground (hidden by default) -->
<div class="playground-wrapper">
    <h3>Test Playground</h3>
    <div id="test-playground"></div>
</div>

</body>
</html>