Skip to content

Commit 4f14b91

Browse files
test(webidl): use data-idl element selectors for full ID uniqueness assertions, rebuild all profiles
Agent-Logs-Url: https://github.com/speced/respec/sessions/1df25aea-6a45-4a46-8dee-96011a47c3f2 Co-authored-by: marcoscaceres <870154+marcoscaceres@users.noreply.github.com>
1 parent b72a68f commit 4f14b91

9 files changed

Lines changed: 623 additions & 622 deletions

File tree

builds/respec-aom.js

Lines changed: 101 additions & 101 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

builds/respec-aom.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

builds/respec-dini.js

Lines changed: 102 additions & 102 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

builds/respec-dini.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

builds/respec-geonovum.js

Lines changed: 77 additions & 77 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

builds/respec-geonovum.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

builds/respec-w3c.js

Lines changed: 329 additions & 329 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

builds/respec-w3c.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/spec/core/webidl-spec.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1803,14 +1803,15 @@ callback CallBack = Z? (X x, optional Y y, /*trivia*/ optional Z z);
18031803
`;
18041804
const ops = makeStandardOps(null, body);
18051805
const doc = await makeRSDoc(ops);
1806-
const foo = doc.getElementById("idl-def-foo");
1807-
const partial1 = doc.getElementById("idl-def-foo-partial-1");
1808-
const partial2 = doc.getElementById("idl-def-foo-partial-2");
1809-
expect(foo).toBeTruthy();
1810-
expect(partial1).toBeTruthy();
1811-
expect(partial2).toBeTruthy();
1812-
// Verify all three IDs are distinct elements
1813-
const ids = new Set([foo.id, partial1.id, partial2.id]);
1814-
expect(ids.size).toBe(3);
1806+
const idls = [
1807+
...doc.querySelectorAll("pre.idl code [data-idl][id]"),
1808+
].filter(el => /^idl-def-foo(?:-partial-[12])?$/.test(el.id));
1809+
expect(idls).toHaveSize(3);
1810+
const ids = idls.map(el => el.id);
1811+
const uniqueIds = new Set(ids);
1812+
expect(uniqueIds.size).toBe(ids.length);
1813+
expect(ids).toContain("idl-def-foo");
1814+
expect(ids).toContain("idl-def-foo-partial-1");
1815+
expect(ids).toContain("idl-def-foo-partial-2");
18151816
});
18161817
});

0 commit comments

Comments
 (0)