| 1 |
<!DOCTYPE html> |
| 2 |
<html lang="en"> |
| 3 |
<head> |
| 4 |
<meta charset="UTF-8"> |
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 6 |
<meta name="htmx-config" content='{"logAll":true}'> |
| 7 |
<title>htmx 4.0 Tests</title> |
| 8 |
|
| 9 |
|
| 10 |
<link rel="stylesheet" href="https://unpkg.com/[email protected]/mocha.css"> |
| 11 |
|
| 12 |
<style> |
| 13 |
.playground-wrapper { |
| 14 |
max-width: 900px; |
| 15 |
margin: 3rem auto; |
| 16 |
padding: 1.5rem; |
| 17 |
border-radius: 12px; |
| 18 |
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); |
| 19 |
} |
| 20 |
|
| 21 |
.playground-wrapper h3 { |
| 22 |
margin: 0 0 1.5rem 0; |
| 23 |
padding-bottom: 0.75rem; |
| 24 |
border-bottom: 3px solid #4CAF50; |
| 25 |
font-size: 1.5rem; |
| 26 |
font-weight: 600; |
| 27 |
} |
| 28 |
|
| 29 |
#test-playground { |
| 30 |
padding: 1.5rem; |
| 31 |
border: 2px solid #e0e0e0; |
| 32 |
border-radius: 8px; |
| 33 |
min-height: 100px; |
| 34 |
} |
| 35 |
|
| 36 |
.header { |
| 37 |
padding: 20px; |
| 38 |
font-family: monospace; |
| 39 |
font-weight: bold; |
| 40 |
} |
| 41 |
|
| 42 |
.run-all-btn { |
| 43 |
display: inline-block; |
| 44 |
margin: 0 20px 20px 20px; |
| 45 |
padding: 10px 20px; |
| 46 |
background-color: #4CAF50; |
| 47 |
color: white; |
| 48 |
text-decoration: none; |
| 49 |
font-family: sans-serif; |
| 50 |
font-weight: 600; |
| 51 |
font-size: 14px; |
| 52 |
transition: background-color 0.2s; |
| 53 |
} |
| 54 |
|
| 55 |
.run-all-btn:hover { |
| 56 |
background-color: #45a049; |
| 57 |
} |
| 58 |
|
| 59 |
.run-all-btn:active { |
| 60 |
background-color: #3d8b40; |
| 61 |
} |
| 62 |
</style> |
| 63 |
|
| 64 |
|
| 65 |
<script src="https://unpkg.com/[email protected]/chai.js"></script> |
| 66 |
<script src="https://unpkg.com/[email protected]/mocha.js"></script> |
| 67 |
|
| 68 |
<script src="lib/fetch-mock.js"></script> |
| 69 |
|
| 70 |
|
| 71 |
<script src="../src/htmx.js"></script> |
| 72 |
|
| 73 |
<script> |
| 74 |
// Initialize Mocha |
| 75 |
mocha.setup({ |
| 76 |
ui: 'bdd', |
| 77 |
fullTrace: true |
| 78 |
}); |
| 79 |
window.assert = chai.assert; |
| 80 |
window.should = chai.should(); |
| 81 |
</script> |
| 82 |
|
| 83 |
|
| 84 |
<script src="./lib/helpers.js"></script> |
| 85 |
|
| 86 |
<script src="./tests/end2end/events.js"></script> |
| 87 |
|
| 88 |
<script> |
| 89 |
// Run tests on load |
| 90 |
window.addEventListener('load', () => { |
| 91 |
mocha.run(); |
| 92 |
}); |
| 93 |
</script> |
| 94 |
|
| 95 |
</head> |
| 96 |
<body> |
| 97 |
<div class="header"> |
| 98 |
<h1>htmx 4.0 Test Suite</h1> |
| 99 |
</div> |
| 100 |
|
| 101 |
<a href="test.html" class="run-all-btn">Run All</a> |
| 102 |
|
| 103 |
|
| 104 |
<div id="mocha"></div> |
| 105 |
|
| 106 |
|
| 107 |
<div class="playground-wrapper"> |
| 108 |
<h3>Test Playground</h3> |
| 109 |
<div id="test-playground"></div> |
| 110 |
</div> |
| 111 |
|
| 112 |
</body> |
| 113 |
</html> |