Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 1 addition & 3 deletions tests/spec/core/dfn-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -418,9 +418,7 @@
expect(dfn.dataset.export).toBe("");
});

// TODO: failing for Chrome, but not Firefox. Needs investigation.
// eslint-disable-next-line jasmine/no-disabled-tests
xit("handles bad attributes", async () => {
it("handles bad attributes", async () => {
const body = html`
<section>
<h2>Attributes</h2>
Expand All @@ -433,7 +431,7 @@
const doc = await makeRSDoc(ops);

const errors = findDfnErrors(doc);
expect(errors).toHaveSize(1);

Check failure on line 434 in tests/spec/core/dfn-spec.js

View workflow job for this annotation

GitHub Actions / Karma Unit Tests (ChromeHeadless)

Core β€” Definitions CSS class based definitions types handles bad attributes Expected [ ] to have size 1.
expect(errors[0].message).toContain("-attribute");
});

Expand Down
16 changes: 8 additions & 8 deletions tests/spec/core/validators-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@
}
});

// TODO: failing for Chrome, but not Firefox. Needs investigation.
// eslint-disable-next-line jasmine/no-disabled-tests
xit("generates an error if the element name is not valid", () => {
const elements = ["my element", "crypto$", "πŸͺ³", "-something", ""];
it("generates an error if the element name is not valid", () => {
// Note: emoji like πŸͺ³ (U+1FAB3) are valid NameStartChar per XML
// [#x10000-#xEFFFF], so Chrome correctly does NOT throw for them.
const elements = ["my element", "crypto$", "-something", ""];
Comment thread
marcoscaceres marked this conversation as resolved.
Outdated
for (const element of elements) {
const dfn = document.createElement("dfn");
const context = `element name: ${element}`;
expect(validateDOMName(element, "element", dfn, "foo/bar"))
.withContext(context)
.toBeFalse();

Check failure on line 39 in tests/spec/core/validators-spec.js

View workflow job for this annotation

GitHub Actions / Karma Unit Tests (ChromeHeadless)

Core - Validators validateDOMName generates an error if the element name is not valid element name: crypto$: Expected true to be false.
expect(dfn.classList.contains("respec-offending-element"))
.withContext(context)
.toBeTrue();
Expand All @@ -57,16 +57,16 @@
}
});

// TODO: failing for Chrome, but not Firefox. Needs investigation.
// eslint-disable-next-line jasmine/no-disabled-tests
xit("generates an error if the attribute name is invalid", () => {
const attributes = ["-crossorigin", "-whatever-", "aria-πŸ˜‡"];
it("generates an error if the attribute name is invalid", () => {
// Note: emoji like πŸ˜‡ (U+1F607) are valid NameChar per XML
// [#x10000-#xEFFFF], so "aria-πŸ˜‡" is valid and Chrome does not throw.
const attributes = ["-crossorigin", "-whatever-"];
Comment thread
marcoscaceres marked this conversation as resolved.
Outdated
for (const attribute of attributes) {
const context = `attribute name: ${attribute}`;
const dfn = document.createElement("dfn");
expect(validateDOMName(attribute, "element-attr", dfn, "foo/bar"))
.withContext(context)
.toBeFalse();

Check failure on line 69 in tests/spec/core/validators-spec.js

View workflow job for this annotation

GitHub Actions / Karma Unit Tests (ChromeHeadless)

Core - Validators validateDOMName generates an error if the attribute name is invalid attribute name: -crossorigin: Expected true to be false.
expect(dfn.classList.contains("respec-offending-element"))
.withContext(context)
.toBeTrue();
Expand Down
Loading