Skip to content

Commit e2b6bbb

Browse files
committed
htmx 2.0.7
1 parent 9517b52 commit e2b6bbb

File tree

4 files changed

+161
-7
lines changed

4 files changed

+161
-7
lines changed

src/test/java/org/htmlunit/libraries/HtmxTest2x0x7.java

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,32 @@ public class HtmxTest2x0x7 extends HtmxTest {
3131
* @throws Exception if an error occurs
3232
*/
3333
@Test
34-
@Alerts(DEFAULT = "passes:814failures:1",
35-
FF = "passes:810failures:1",
36-
FF_ESR = "passes:809failures:2")
34+
@Alerts(DEFAULT = "passes:739failures:1",
35+
FF = "passes:734failures:2",
36+
FF_ESR = "passes:734failures:2")
3737
@HtmlUnitNYI(
38-
CHROME = "passes:822failures:0",
39-
EDGE = "passes:822failures:0")
38+
CHROME = "passes:721failures:20",
39+
EDGE = "passes:721failures:20",
40+
FF = "passes:720failures:18",
41+
FF_ESR = "passes:720failures:18")
4042
public void htmx() throws Exception {
41-
htmx("htmx-2.0.7");
43+
htmx("htmx-2.0.7", false);
44+
}
45+
46+
/**
47+
* @throws Exception if an error occurs
48+
*/
49+
@Test
50+
@Alerts(DEFAULT = "passes:636failures:104",
51+
FF = "passes:637failures:99",
52+
FF_ESR = "passes:637failures:99")
53+
@HtmlUnitNYI(
54+
CHROME = "passes:620failures:119",
55+
EDGE = "passes:620failures:119",
56+
FF = "passes:620failures:119",
57+
FF_ESR = "passes:620failures:119")
58+
public void htmxMin() throws Exception {
59+
htmx("htmx-2.0.7", true);
4260
}
4361

4462
@Override

src/test/resources/libraries/htmx/htmx-2.0.7/test/attributes/hx-swap-oob.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ describe('hx-swap-oob attribute', function() {
260260
byId('td1').innerHTML.should.equal('hey')
261261
})
262262
}
263+
263264
/* HtmlUnit class syntax not supported so far
264265
for (const config of [{ allowNestedOobSwaps: true }, { allowNestedOobSwaps: false }]) {
265266
it('handles oob target in web components with both inside shadow root and config ' + JSON.stringify(config), function() {

src/test/resources/libraries/htmx/htmx-2.0.7/test/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ <h2>Mocha Test Suite</h2>
7272
<script src="core/headers.js"></script>
7373
<script src="core/regressions.js"></script>
7474
<script src="core/security.js"></script>
75-
<script src="core/shadowdom.js"></script>
75+
<!-- HtmlUnit shadowdom not supported so far script src="core/shadowdom.js"></script -->
7676
<script src="core/perf.js"></script>
7777
<script src="core/validation.js"></script>
7878
<script src="core/tokenizer.js"></script>
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
<html lang="en">
2+
<head>
3+
<meta charset="utf-8" />
4+
<title>Mocha Tests</title>
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<link rel="stylesheet" href="../node_modules/mocha/mocha.css" />
7+
<meta http-equiv="cache-control" content="no-cache, must-revalidate, post-check=0, pre-check=0" />
8+
<meta http-equiv="cache-control" content="max-age=0" />
9+
<meta http-equiv="expires" content="0" />
10+
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
11+
<meta http-equiv="pragma" content="no-cache" />
12+
<meta name="htmx-config" content='{"historyEnabled":false,"defaultSettleDelay":0}'>
13+
</head>
14+
<body style="padding:20px;font-family: sans-serif">
15+
16+
<h1 style="margin-top: 40px">htmx.js test suite</h1>
17+
<p id="version-number">Version:&nbsp;</p>
18+
19+
<h2>Scratch Page</h2>
20+
<ul>
21+
<li>
22+
<a href="scratch/scratch.html">Scratch Page</a>
23+
</li>
24+
</ul>
25+
26+
<h2>Manual Tests</h2>
27+
<a href="manual/">Here</a>
28+
29+
<h2>Mocha Test Suite</h2>
30+
<a href="index.html">[ALL]</a>
31+
32+
<script src="../node_modules/chai/chai.js"></script>
33+
<script src="../node_modules/chai-dom/chai-dom.js"></script>
34+
<script src="../node_modules/mocha/mocha.js"></script>
35+
<script src="../node_modules/sinon/pkg/sinon.js"></script>
36+
<script src="../node_modules/mock-socket/dist/mock-socket.js"></script>
37+
<script src="../src/htmx.min.js"></script>
38+
<script>
39+
// Do not log all the events in headless mode (the log output is enormous)
40+
if (navigator.webdriver) {
41+
htmx.logAll = function () { }
42+
}
43+
44+
// Add the version number to the top
45+
document.getElementById('version-number').innerText += htmx.version
46+
</script>
47+
48+
<script class="mocha-init">
49+
mocha.setup({
50+
ui: "bdd",
51+
timeout: 4000,
52+
rootHooks: {
53+
beforeEach(done) {
54+
console.log(`${this?.currentTest?.parent?.title} - ${this?.currentTest?.title}`)
55+
done()
56+
},
57+
},
58+
})
59+
mocha.checkLeaks();
60+
window.should = window.chai.should()
61+
</script>
62+
63+
<script src="util/util.js"></script>
64+
65+
<!-- core tests -->
66+
<script src="core/internals.js"></script>
67+
<script src="core/api.js"></script>
68+
<script src="core/ajax.js"></script>
69+
<script src="core/config.js"></script>
70+
<script src="core/verbs.js"></script>
71+
<script src="core/parameters.js"></script>
72+
<script src="core/headers.js"></script>
73+
<script src="core/regressions.js"></script>
74+
<script src="core/security.js"></script>
75+
<!-- HtmlUnit shadowdom not supported so far script src="core/shadowdom.js"></script -->
76+
<script src="core/perf.js"></script>
77+
<script src="core/validation.js"></script>
78+
<script src="core/tokenizer.js"></script>
79+
<script src="core/extensions.js"></script>
80+
<script src="core/extension-swap.js"></script>
81+
82+
<!-- attribute tests -->
83+
<script src="attributes/hx-boost.js"></script>
84+
<script src="attributes/hx-confirm.js"></script>
85+
<script src="attributes/hx-delete.js"></script>
86+
<script src="attributes/hx-ext.js"></script>
87+
<script src="attributes/hx-get.js"></script>
88+
<script src="attributes/hx-headers.js"></script>
89+
<script src="attributes/hx-history.js"></script>
90+
<script src="attributes/hx-history-elt.js"></script>
91+
<script src="attributes/hx-include.js"></script>
92+
<script src="attributes/hx-indicator.js"></script>
93+
<script src="attributes/hx-disabled-elt.js"></script>
94+
<script src="attributes/hx-inherit.js"></script>
95+
<script src="attributes/hx-disinherit.js"></script>
96+
<script src="attributes/hx-on-wildcard.js"></script>
97+
<script src="attributes/hx-params.js"></script>
98+
<script src="attributes/hx-patch.js"></script>
99+
<script src="attributes/hx-post.js"></script>
100+
<script src="attributes/hx-preserve.js"></script>
101+
<script src="attributes/hx-prompt.js"></script>
102+
<script src="attributes/hx-push-url.js"></script>
103+
<script src="attributes/hx-put.js"></script>
104+
<script src="attributes/hx-replace-url.js"></script>
105+
<script src="attributes/hx-request.js"></script>
106+
<script src="attributes/hx-select.js"></script>
107+
<script src="attributes/hx-select-oob.js"></script>
108+
<script src="attributes/hx-swap-oob.js"></script>
109+
<script src="attributes/hx-swap.js"></script>
110+
<script src="attributes/hx-sync.js"></script>
111+
<script src="attributes/hx-target.js"></script>
112+
<script src="attributes/hx-trigger.js"></script>
113+
<script src="attributes/hx-vals.js"></script>
114+
<script src="attributes/hx-vars.js"></script>
115+
116+
<!-- this hyperscript integration should be removed once its removed from the tests -->
117+
<script src="lib/_hyperscript.js"></script>
118+
119+
<!-- events last so they don't screw up other tests -->
120+
<script src="core/events.js"></script>
121+
122+
<div id="mocha"></div>
123+
124+
<script class="mocha-exec">
125+
document.addEventListener("DOMContentLoaded", function () {
126+
mocha.run();
127+
})
128+
</script>
129+
<div hx-trigger="restored" hidden>just for htmx:restored event testing</div>
130+
<em>Work Area</em>
131+
<hr/>
132+
<div id="work-area" hx-history-elt>
133+
</div>
134+
</body>
135+
</html>

0 commit comments

Comments
 (0)