Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions tests/old-browsers.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<title>Older browser compatibility tests</title>
<link rel="stylesheet" href="https://htest.dev/htest.css" crossorigin />
<script type="module">
import adoptCSS from "../src/util/adopt-css.js";

// Import all the tests we have.
// Declarative shadow DOM is not supported in old browsers,
// so we skip corresponding tests
let skip = ["Declarative"];
let tests = await import("./index-fn.js").then(m => m.default).then(m => m.tests);
tests = tests.map(test => {
return {
...test,
throws: false,
tests: test.tests.map(t => {
if (!skip.includes(t.name)) {
return t;
}

return {
...t,
skip: true,
}
}),
}
});

let render = await import("https://htest.dev/src/render.js").then(m => m.default);
render({
name: "Older browser compatibility tests",
tests,
});

// Enable hTest features like test isolation, navigation, etc.
import("https://htest.dev/htest.js");
</script>
</head>

<body>
<registered-component></registered-component>
</body>

</html>
4 changes: 2 additions & 2 deletions tests/records.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ export default {
return actual === 1 || actual === 2;
},
arg: {
properties: properties.toReversed(),
values: values.toReversed(),
properties: [...properties].reverse(),
values: [...values].reverse(),
pause: TIMEOUT / 2.5
},
expect: "1 – 2"
Expand Down
6 changes: 4 additions & 2 deletions tests/transition.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ let testsDynamic = [
},
];

let testIndex = 1;

export default {
name: "The existing transition property",

Expand All @@ -95,9 +97,9 @@ export default {
}, 50);
}
else {
let id = crypto.randomUUID();
id = property + "-" + id;
let id = `transition-${ property }-test-${ testIndex }`;
this.target.id = id;
testIndex += 1;

// Avoid race condition in Safari < 18.2
setTimeout(() => {
Expand Down