Skip to content

Commit c218012

Browse files
committed
test: td.gce-code の color 指定をセレクタとの近傍で検証するよう強化
color: var(--gce-code-text) が td.gce-code セレクタより後ろに現れることを アサートし、誤ったセレクタへの記述を検出できるようにした。
1 parent 0898893 commit c218012

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

test/styles.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,10 @@ describe("CSS (テーマ: light)", () => {
162162
});
163163

164164
it("td.gce-code に基本テキスト色の CSS 変数を含む", () => {
165-
expect(CSS).toContain("color: var(--gce-code-text)");
165+
const selectorIdx = CSS.indexOf("td.gce-code");
166+
const colorIdx = CSS.indexOf("color: var(--gce-code-text)");
167+
expect(selectorIdx).toBeGreaterThan(-1);
168+
expect(colorIdx).toBeGreaterThan(selectorIdx);
166169
});
167170

168171
it("scrollbar-color サポートブラウザ向けの @supports ブロックを含む", () => {

0 commit comments

Comments
 (0)