28 lines
1.2 KiB
HTML
28 lines
1.2 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<meta charset="utf-8">
|
|
<title>Conversation navigation regression tests</title>
|
|
<h1>Conversation navigation regression tests</h1>
|
|
<div id="testTitle"></div>
|
|
<input id="testModel" aria-label="Model">
|
|
<input id="chatSearchInput" aria-label="Search">
|
|
<textarea id="msgInput" aria-label="Draft"></textarea>
|
|
<div id="messages"></div>
|
|
<pre id="results">Running...</pre>
|
|
<script type="module">
|
|
import {registerConversationTests} from "/browser-tests/conversationCases.js";
|
|
const cases = [], results = [];
|
|
const assert = {
|
|
equal(actual, expected) { if (!Object.is(actual, expected)) throw new Error(`Expected ${expected}, received ${actual}`); },
|
|
deepEqual(actual, expected) { this.equal(JSON.stringify(actual), JSON.stringify(expected)); }
|
|
};
|
|
registerConversationTests((name, run) => cases.push({name, run}), assert);
|
|
for (const {name, run} of cases) {
|
|
try { await run(); results.push(`PASS ${name}`); }
|
|
catch (error) { results.push(`FAIL ${name}: ${error.stack}`); }
|
|
}
|
|
document.getElementById("results").textContent = results.join("\n");
|
|
document.title = `${results.filter(result => result.startsWith("PASS")).length}/${cases.length} navigation tests passed`;
|
|
</script>
|
|
</html>
|