Skip to content
Draft
Show file tree
Hide file tree
Changes from 2 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
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
20 changes: 11 additions & 9 deletions tests/spec/core/validators-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"feGaussianBlur",
"body",
"html",
"🪳",
];
for (const element of elements) {
const dfn = document.createElement("dfn");
Expand All @@ -27,16 +28,14 @@
}
});

// 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", () => {
const elements = ["my element", "crypto$", "-something", ""];
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 38 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 @@ -44,7 +43,12 @@
});

it("doesn't generates an error if the attribute name is valid", () => {
const attributes = ["crossorigin", "aria-hidden", "aria-roledescription"];
const attributes = [
"crossorigin",
"aria-hidden",
"aria-roledescription",
"aria-😇",
];
for (const attribute of attributes) {
const context = `attribute name: ${attribute}`;
const dfn = document.createElement("dfn");
Expand All @@ -57,16 +61,14 @@
}
});

// 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", () => {
const attributes = ["-crossorigin", "-whatever-"];
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 71 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