Skip to content

Commit 24f54f2

Browse files
committed
test: auto テーマのダーク側 --gce-code-text が @media ブロック内に現れることを検証
1 parent eddacda commit 24f54f2

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

test/styles.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,14 @@ describe("buildThemeCSS", () => {
129129
expect(afterMedia).toContain(DARK_COLORS);
130130
});
131131

132+
it('"auto" → ダーク側の --gce-code-text が @media ブロック内に現れる', () => {
133+
const css = buildThemeCSS("auto");
134+
const mediaStart = css.indexOf("@media (prefers-color-scheme: dark)");
135+
expect(mediaStart).toBeGreaterThan(-1);
136+
const afterMedia = css.slice(mediaStart);
137+
expect(afterMedia).toContain("--gce-code-text: #e6edf3");
138+
});
139+
132140
it('"auto" → LIGHT_COLORS が DARK_COLORS より前に現れる', () => {
133141
const css = buildThemeCSS("auto");
134142
expect(css.indexOf(LIGHT_COLORS)).toBeLessThan(css.indexOf(DARK_COLORS));

0 commit comments

Comments
 (0)