Skip to content

Commit 337746c

Browse files
committed
retested and min added
1 parent 7723689 commit 337746c

File tree

3 files changed

+155
-3
lines changed

3 files changed

+155
-3
lines changed

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

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
*/
1515
package org.htmlunit.libraries;
1616

17+
import org.htmlunit.WebClient;
1718
import org.htmlunit.junit.annotation.Alerts;
1819
import org.htmlunit.junit.annotation.HtmlUnitNYI;
1920
import org.junit.jupiter.api.Test;
@@ -33,9 +34,36 @@ public class HtmxTest2x0x2 extends HtmxTest {
3334
FF = "passes:579failures:0",
3435
FF_ESR = "passes:579failures:0")
3536
@HtmlUnitNYI(
36-
CHROME = "passes:579failures:0",
37-
EDGE = "passes:579failures:0")
37+
CHROME = "passes:576failures:3",
38+
EDGE = "passes:576failures:3",
39+
FF = "passes:576failures:3",
40+
FF_ESR = "passes:576failures:3")
3841
public void htmx() throws Exception {
39-
htmx("htmx-2.0.2");
42+
htmx("htmx-2.0.2", false);
43+
}
44+
45+
/**
46+
* @throws Exception if an error occurs
47+
*/
48+
@Test
49+
@Alerts(DEFAULT = "passes:514failures:66",
50+
FF = "passes:514failures:65",
51+
FF_ESR = "passes:514failures:65")
52+
@HtmlUnitNYI(
53+
CHROME = "passes:511failures:68",
54+
EDGE = "passes:511failures:68",
55+
FF = "passes:511failures:68",
56+
FF_ESR = "passes:511failures:68")
57+
public void htmxMin() throws Exception {
58+
htmx("htmx-2.0.2", true);
59+
}
60+
61+
@Override
62+
protected void setupWebClient(final WebClient webClient) {
63+
super.setupWebClient(webClient);
64+
65+
// min
66+
// ReferenceError: "getInputValues" is not defined.
67+
webClient.getOptions().setThrowExceptionOnScriptError(false);
4068
}
4169
}

src/test/resources/libraries/htmx/htmx-2.0.2/src/htmx.min.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
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/mocha-webdriver-runner/dist/mocha-webdriver-client.js"></script>
36+
<script src="../node_modules/sinon/pkg/sinon.js"></script>
37+
<script src="../node_modules/mock-socket/dist/mock-socket.js"></script>
38+
<script src="../src/htmx.min.js"></script>
39+
<script>
40+
// Do not log all the events in headless mode (the log output is enormous)
41+
if (navigator.webdriver) {
42+
htmx.logAll = function () { }
43+
}
44+
45+
// Add the version number to the top
46+
document.getElementById('version-number').innerText += htmx.version
47+
</script>
48+
49+
<script class="mocha-init">
50+
mocha.setup({ui: 'bdd', timeout: 4000 });
51+
mocha.checkLeaks();
52+
window.should = window.chai.should()
53+
</script>
54+
55+
<script src="util/util.js"></script>
56+
57+
<!-- core tests -->
58+
<script src="core/internals.js"></script>
59+
<script src="core/api.js"></script>
60+
<script src="core/ajax.js"></script>
61+
<script src="core/config.js"></script>
62+
<script src="core/verbs.js"></script>
63+
<script src="core/parameters.js"></script>
64+
<script src="core/headers.js"></script>
65+
<script src="core/regressions.js"></script>
66+
<script src="core/security.js"></script>
67+
<!-- HtmlUnit shadowdom not supported so far script src="core/shadowdom.js"></script -->
68+
<script src="core/perf.js"></script>
69+
<script src="core/validation.js"></script>
70+
<script src="core/tokenizer.js"></script>
71+
<script src="core/extensions.js"></script>
72+
<script src="core/extension-swap.js"></script>
73+
74+
<!-- attribute tests -->
75+
<script src="attributes/hx-boost.js"></script>
76+
<script src="attributes/hx-confirm.js"></script>
77+
<script src="attributes/hx-delete.js"></script>
78+
<script src="attributes/hx-ext.js"></script>
79+
<script src="attributes/hx-get.js"></script>
80+
<script src="attributes/hx-headers.js"></script>
81+
<script src="attributes/hx-history.js"></script>
82+
<script src="attributes/hx-include.js"></script>
83+
<script src="attributes/hx-indicator.js"></script>
84+
<script src="attributes/hx-disabled-elt.js"></script>
85+
<script src="attributes/hx-inherit.js"></script>
86+
<script src="attributes/hx-disinherit.js"></script>
87+
<script src="attributes/hx-on-wildcard.js"></script>
88+
<script src="attributes/hx-params.js"></script>
89+
<script src="attributes/hx-patch.js"></script>
90+
<script src="attributes/hx-post.js"></script>
91+
<script src="attributes/hx-preserve.js"></script>
92+
<script src="attributes/hx-push-url.js"></script>
93+
<script src="attributes/hx-put.js"></script>
94+
<script src="attributes/hx-request.js"></script>
95+
<script src="attributes/hx-select.js"></script>
96+
<script src="attributes/hx-select-oob.js"></script>
97+
<script src="attributes/hx-swap-oob.js"></script>
98+
<script src="attributes/hx-swap.js"></script>
99+
<script src="attributes/hx-sync.js"></script>
100+
<script src="attributes/hx-target.js"></script>
101+
<script src="attributes/hx-trigger.js"></script>
102+
<script src="attributes/hx-vals.js"></script>
103+
<script src="attributes/hx-vars.js"></script>
104+
105+
<!-- this hyperscript integration should be removed once its removed from the tests -->
106+
<script src="lib/_hyperscript.js"></script>
107+
108+
<!-- events last so they don't screw up other tests -->
109+
<script src="core/events.js"></script>
110+
111+
<div id="mocha"></div>
112+
113+
<script class="mocha-exec">
114+
document.addEventListener("DOMContentLoaded", function () {
115+
mocha.run();
116+
})
117+
</script>
118+
<em>Work Area</em>
119+
<hr/>
120+
<div id="work-area" hx-history-elt>
121+
</div>
122+
</body>
123+
</html>

0 commit comments

Comments
 (0)