Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 5 additions & 1 deletion styles/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,11 @@ a.language-nav-link:hover {
letter-spacing: -0.025em;
}

.lesson-body h2:first-child {
.lesson-body > h2:not(:first-child) {
border-top: 1px solid var(--color-border);
}

.lesson-body > h2:first-child {
padding-top: 0;
margin-top: 0;
}
Expand Down
16 changes: 16 additions & 0 deletions tests/accessibility.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,22 @@ test("긴 교안 제목과 인라인 코드가 320px 문서 폭을 늘리지 않
assert.match(inlineCodeRule[1], /background:\s*var\(--color-surface-raised\)/);
});

test("교안의 주요 주제 H2만 위쪽 구분선으로 구분한다", async () => {
const css = await readFile(new URL("../styles/app.css", import.meta.url), "utf8");
const h2Rule = css.match(/\.lesson-body h2\s*\{([^}]*)\}/)?.[1] ?? "";
const subsequentH2Rule = css.match(/\.lesson-body > h2:not\(:first-child\)\s*\{([^}]*)\}/)?.[1] ?? "";
const firstH2Rule = css.match(/\.lesson-body > h2:first-child\s*\{([^}]*)\}/)?.[1] ?? "";
const h3Rule = css.match(/\.lesson-body h3\s*\{([^}]*)\}/)?.[1] ?? "";
const h4Rule = css.match(/\.lesson-body h4\s*\{([^}]*)\}/)?.[1] ?? "";

assert.doesNotMatch(h2Rule, /border-top/);
assert.match(subsequentH2Rule, /border-top:\s*1px solid var\(--color-border\)/);
assert.match(firstH2Rule, /padding-top:\s*0/);
assert.match(firstH2Rule, /margin-top:\s*0/);
assert.doesNotMatch(h3Rule, /border-top/);
assert.doesNotMatch(h4Rule, /border-top/);
});

test("교안 표는 명확한 셀 경계와 포커스 가능한 내부 가로 스크롤을 유지한다", async () => {
const css = await readFile(new URL("../styles/app.css", import.meta.url), "utf8");
const tokens = await readFile(new URL("../styles/tokens.css", import.meta.url), "utf8");
Expand Down
3 changes: 1 addition & 2 deletions tests/course-separation.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,9 @@ test("모든 교안은 원문 학습 목표를 hero에 한 번만 렌더링하
if (markdown.includes("## 면접 답변 예시")) {
assert.match(
body,
/<section class="lesson-model-answer"[^>]*role="region"[^>]*tabindex="-1"[^>]*aria-labelledby="면접-답변-예시"[^>]* hidden>/,
/<section class="lesson-model-answer"[^>]*role="region"[^>]*tabindex="-1"[^>]*aria-labelledby="면접-답변-예시"[^>]* hidden>\s*<h2 id="면접-답변-예시">면접 답변 예시<\/h2>/,
lesson.id,
);
assert.match(body, /<h2 id="면접-답변-예시">면접 답변 예시<\/h2>/, lesson.id);
assert.match(
body,
/data-toggle-model-answer[^>]*aria-controls="lesson-model-answer"[^>]*aria-describedby="lesson-model-answer-help"[^>]*aria-expanded="false"[^>]*>면접 답변 보기<\/button>/,
Expand Down
Loading