fix(admin-template): 사이트맵 상태 wait_for 누락 + stale 레이아웃 테스트 5건 교정

작업 중 전체 Vitest 스위트에서 사전 결함 6건을 발견해 같은 세션에서 종결한다.

SEO 탭의 sitemap_status 가 transition_overlay.wait_for 에 빠져 있어, 오버레이가
먼저 걷히며 진행상황 블록이 빈 상태로 잠깐 노출될 수 있었다. 구조가 동일한
policies 는 등록돼 있어 설계 의도가 아닌 누락으로 판정했다.

나머지 5건은 로직이 아니라 테스트가 낡은 것이었다. 사이드바 테스트는 프로필 UI
부재라는 의도 대신 컨테이너 id 부재로 단언해 이후 재도입된 크로스 이동 링크에
걸렸고, 대시보드 테스트는 iteration id 보간 도입 후에도 정확 일치로만 노드를
찾고 있었다. 각각 의도에 맞게 교정하고 반대 방향 회귀 가드를 보강했다.
This commit is contained in:
HeuJung committed 2026-07-20 14:39:13 +09:00
1 parent 062a88ca04
commit cbf8ce1555
5 files changed
+81 -9

No files matched your search

@@ -295,3 +295,36 @@ test('#481 - 재생성 후 실시간/폴링 모드에 맞게 진행상황이 갱
expect(statusGets).toBeLessThanOrEqual(2);
}
});
// @scenario tab=seo, transition_overlay=wait_for
// @effects sitemap_status_awaited_before_reveal
test('#481 - SEO 탭 콘텐츠 노출 시점에 sitemap 상태가 이미 채워져 있다', async ({ page }) => {
const token = issueToken('core.settings.read', 'core.settings.update');
await authenticatePage(page, token);
// 상태 API 를 의도적으로 지연시켜, 전환 오버레이가 이 데이터소스를 기다리는지 드러낸다.
// wait_for 에 sitemap_status 가 빠져 있으면 오버레이가 먼저 걷히고 빈 상태로 노출된다.
let statusResolvedAt = 0;
await page.route('**/api/admin/seo/sitemap/status*', async (route) => {
await new Promise((r) => setTimeout(r, 1_500));
statusResolvedAt = Date.now();
await route.continue();
});
await page.goto('/admin/settings?tab=seo');
await page.waitForLoadState('domcontentloaded', { timeout: 30_000 });
// 진행상황 블록이 보이는 시점 = 오버레이가 걷힌 시점
const statusBlock = page.locator('#sitemap_last_updated_block');
await expect(statusBlock).toBeVisible({ timeout: 30_000 });
const revealedAt = Date.now();
// 상대 비교: 노출 시점이 상태 응답 이후여야 한다 (절대 임계값 사용 안 함)
expect(statusResolvedAt).toBeGreaterThan(0);
expect(revealedAt).toBeGreaterThanOrEqual(statusResolvedAt);
// 노출된 내용이 빈 껍데기가 아니어야 한다 (미해석 바인딩/빈 문자열 회귀 가드)
const text = (await statusBlock.innerText()).trim();
expect(text).not.toContain('$t:');
expect(text.length).toBeGreaterThan(0);
});