Skip to content

Commit eddacda

Browse files
committed
test: td.gce-code ブロック内に color 宣言があることを正確に検証
セレクタより後ろにあるだけでなく、対象ブロックの閉じ括弧より前に color: var(--gce-code-text) が存在することを確認し、 誤ったセレクタへの配置を確実に検出できるようにした。
1 parent c218012 commit eddacda

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

test/styles.test.ts

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

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

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

0 commit comments

Comments
 (0)