summaryrefslogtreecommitdiffstatshomepage
path: root/www/static/test/index.html
blob: fb4473b0bdbe281da9a181b7db4328c87b6158f7 (plain) (blame)
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>Mocha Tests</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="stylesheet" href="../node_modules/mocha/mocha.css" />
    <meta http-equiv="cache-control" content="no-cache, must-revalidate, post-check=0, pre-check=0" />
    <meta http-equiv="cache-control" content="max-age=0" />
    <meta http-equiv="expires" content="0" />
    <meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
    <meta http-equiv="pragma" content="no-cache" />
    <meta name="htmx-config" content='{"historyEnabled":false,"defaultSettleDelay":0}'>
</head>
<body style="padding:20px;font-family: sans-serif">

<h1 style="margin-top: 40px">htmx.js test suite</h1>
<p id="version-number">Version:&nbsp;</p>

<h2>Scratch Page</h2>
<ul>
    <li>
        <a href="scratch/scratch.html">Scratch Page</a>
    </li>
</ul>

<h2>Manual Tests</h2>
<a href="manual/">Here</a>

<h2>Mocha Test Suite</h2>
<a href="index.html">[ALL]</a>

<script src="../node_modules/chai/chai.js"></script>
<script src="../node_modules/chai-dom/chai-dom.js"></script>
<script src="../node_modules/mocha/mocha.js"></script>
<script src="../node_modules/sinon/pkg/sinon.js"></script>
<script src="../node_modules/mock-socket/dist/mock-socket.js"></script>
<script src="../src/htmx.js"></script>
<script>
  // Do not log all the events in headless mode (the log output is enormous)
  if (navigator.webdriver) {
    htmx.logAll = function () { }
  }

  // Add the version number to the top
  document.getElementById('version-number').innerText += htmx.version
</script>

<script class="mocha-init">
    mocha.setup({
        ui: "bdd",
        rootHooks: {
            beforeEach(done) {
                console.log(`${this?.currentTest?.parent?.title} - ${this?.currentTest?.title}`)
                done()
            },
        },
    })
    mocha.checkLeaks();
    window.should = window.chai.should()
</script>

<script src="util/util.js"></script>

<!-- core tests -->
<script src="core/internals.js"></script>
<script src="core/api.js"></script>
<script src="core/ajax.js"></script>
<script src="core/config.js"></script>
<script src="core/verbs.js"></script>
<script src="core/parameters.js"></script>
<script src="core/headers.js"></script>
<script src="core/regressions.js"></script>
<script src="core/security.js"></script>
<script src="core/shadowdom.js"></script>
<script src="core/perf.js"></script>
<script src="core/validation.js"></script>
<script src="core/tokenizer.js"></script>
<script src="core/extensions.js"></script>
<script src="core/extension-swap.js"></script>

<!-- attribute tests -->
<script src="attributes/hx-boost.js"></script>
<script src="attributes/hx-confirm.js"></script>
<script src="attributes/hx-delete.js"></script>
<script src="attributes/hx-ext.js"></script>
<script src="attributes/hx-get.js"></script>
<script src="attributes/hx-headers.js"></script>
<script src="attributes/hx-history.js"></script>
<script src="attributes/hx-history-elt.js"></script>
<script src="attributes/hx-include.js"></script>
<script src="attributes/hx-indicator.js"></script>
<script src="attributes/hx-disabled-elt.js"></script>
<script src="attributes/hx-inherit.js"></script>
<script src="attributes/hx-disinherit.js"></script>
<script src="attributes/hx-on-wildcard.js"></script>
<script src="attributes/hx-params.js"></script>
<script src="attributes/hx-patch.js"></script>
<script src="attributes/hx-post.js"></script>
<script src="attributes/hx-preserve.js"></script>
<script src="attributes/hx-prompt.js"></script>
<script src="attributes/hx-push-url.js"></script>
<script src="attributes/hx-put.js"></script>
<script src="attributes/hx-replace-url.js"></script>
<script src="attributes/hx-request.js"></script>
<script src="attributes/hx-select.js"></script>
<script src="attributes/hx-select-oob.js"></script>
<script src="attributes/hx-swap-oob.js"></script>
<script src="attributes/hx-swap.js"></script>
<script src="attributes/hx-sync.js"></script>
<script src="attributes/hx-target.js"></script>
<script src="attributes/hx-trigger.js"></script>
<script src="attributes/hx-vals.js"></script>
<script src="attributes/hx-vars.js"></script>

<!-- this hyperscript integration should be removed once its removed from the tests -->
<script src="lib/_hyperscript.js"></script>

<!-- events last so they don't screw up other tests -->
<script src="core/events.js"></script>

<div id="mocha"></div>

<script class="mocha-exec">
    document.addEventListener("DOMContentLoaded", function () {
        mocha.run();
    })
</script>
<div hx-trigger="restored" hidden>just for htmx:restored event testing</div>
<em>Work Area</em>
<hr/>
<div id="work-area" hx-history-elt>
</div>
</body>
</html>