Skip to content
This repository has been archived by the owner on Jun 7, 2024. It is now read-only.

Commit

Permalink
test(w3c/style): add check for meta[name="color-scheme"] (speced#4682)
Browse files Browse the repository at this point in the history
  • Loading branch information
sidvishnoi committed Apr 11, 2024
1 parent 60b5d1e commit dfab903
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/spec/w3c/style-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,9 @@ describe("W3C - Style", () => {
const elem = doc.querySelector(`link[href^='${url}'][rel="stylesheet"]`);
expect(elem).toBeTruthy();
expect(elem.nextElementSibling).toBeFalsy();

const colorSchemaMeta = doc.querySelector("meta[name='color-scheme']");
expect(colorSchemaMeta).toBeFalsy();
});

it("should add dark mode stylesheet", async () => {
Expand All @@ -213,6 +216,9 @@ describe("W3C - Style", () => {
expect(elem).toBeTruthy();
expect(elem.href).toBe(url);
expect(elem.getAttribute("media")).toBe("(prefers-color-scheme: dark)");
const colorSchemaMeta = doc.querySelector("meta[name='color-scheme']");
expect(colorSchemaMeta).toBeTruthy();
expect(colorSchemaMeta.content).toBe("light dark");
});

it("should add W3C darkmode stylesheet at the end", async () => {
Expand Down

0 comments on commit dfab903

Please sign in to comment.