fix(security): KVE-2026-1914/1915/1919 remediation 전건

위임 관리자(부관리자)가 권한·역할·표현식·비밀 콘텐츠 경계를 우회하던
결함군을 계층 대칭성 원칙으로 전건 차단한다. 약한 경로가 정상 응답을
내보내는 것이 유일한 증상이라, 게이트를 생산 지점 한 곳(SSoT)에 두고
같은 데이터를 내보내는 소비 경로 전부가 그 게이트를 경유하도록 맞췄다.

- 등급 상한(rank ceiling): 슈퍼관리자 보호·역할/사용자 역할 배정(추가·제거
 대칭)·일괄 상태변경·순서변경을 상세 경로와 동일 강도로 재적용. 가드는
 DB 쓰기에 선행하여 거부 시 상태 불변.
- 레이아웃 표현식: new Function/with 실행을 AST 화이트리스트 평가기로 교체.
 비-문자열 computed 키 정규화(normalizeKey)·Object facade(리플렉션 static
 제거)·legacy 접근자 차단. 저장측 검증·정적 검사와 3계층 동형.
- secret 게이트: 비밀글의 댓글·첨부·문의 독립 경로 재적용, hash 파일서빙
 소유권·비밀·발행 상태 검사 통일.
- 신뢰 스크립트 호스트: 확장 선언 기반 + same-origin 브라우저 정규화를
 런타임·저장측·정적검사 3층 동형화.
- 회귀 감지: 단위·Feature·E2E·시나리오 매니페스트 전축 + audit 룰 4종 신설.
This commit is contained in:
HeuJung committed 2026-08-17 01:45:09 +09:00
1 parent cd84b63d2b
commit 71abdeaf60
249 files changed
+14354 -1134

No files matched your search

@@ -10,8 +10,8 @@
* 단위 테스트(Router.test.ts)가 매칭 로직을 잠그지만, 실제 브라우저에서
* 재현한 증상이므로(단위 green + 브라우저 깨짐 방지) 브라우저 레벨로도 잠근다.
*
* @scenario admin_trailing_slash_unauthenticated + admin_no_trailing_slash_unauthenticated
* @effects redirect_to_login_not_404
* 축 요약(마커 아님 — 평문): admin_trailing_slash_unauthenticated, admin_no_trailing_slash_unauthenticated.
* 효과 요약(마커 아님 — 평문): redirect_to_login_not_404.
*/
import { test, expect } from '../../fixtures/auth';
@@ -13,8 +13,8 @@
* 잠근다 — 셀에 파이프를 넣은 화면이 코어 기본 레이아웃에 없으므로, 배포된
* 번들의 `G7Core.renderItemChildren` 를 그대로 호출해 결과를 검증한다.
*
* @scenario cellchildren_pipe_with_args + cellchildren_pipe_without_args + cellchildren_props_pipe
* @effects pipe_formatted_value_rendered
* 축 요약(마커 아님 — 평문): cellchildren_pipe_with_args, cellchildren_pipe_without_args, cellchildren_props_pipe.
* 효과 요약(마커 아님 — 평문): pipe_formatted_value_rendered.
*/
import { test, expect } from '../fixtures/auth';
@@ -11,8 +11,8 @@
* 이라, 본 spec 은 탭 노출/빌더 렌더/조작 결과의 가시 상태만 확인하고 합성 로직 정합성은
* 단위/RTL(actionRecipeEngine/conditionRecipeEngine/s7-property-controls)이 잠근다.
*
* @scenario property_modal_action_tab + property_modal_visibility_tab + flex_editor_section
* @effects action_tab_visible_when_events + visibility_builder_renders + flex_section_for_container
* 축 요약(마커 아님 — 평문): property_modal_action_tab, property_modal_visibility_tab, flex_editor_section.
* 효과 요약(마커 아님 — 평문): action_tab_visible_when_events, visibility_builder_renders, flex_section_for_container.
*/
import { test, expect, issueToken, authenticatePage } from '../../fixtures/auth';
@@ -64,6 +64,7 @@ async function selectNode(page: PwPage, editorPath: string): Promise<boolean> {
}
test.describe('@layout-editor 동작/표시조건/정렬박스 (S7)', () => {
/** @effects visibility_builder_renders */
test('요소 선택 → 속성 모달에 표시조건 탭 + 조건 빌더 렌더', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -128,7 +129,7 @@ test.describe('@layout-editor 동작/표시조건/정렬박스 (S7)', () => {
// ── D-D 회귀 — 컴포넌트 [동작] 탭 ──
// @scenario property_modal_action_tab
// @effects nested_onsuccess_picker_not_empty + action_card_drag_handle_draggable
// @effects nested_onsuccess_picker_not_empty, action_card_drag_handle_draggable
/** [동작] 탭을 가진(events capability) 노드를 찾아 동작 탭을 연다. 못 찾으면 null.
* Button 등 onClick capability 보유 가능성이 높은 노드를 우선 시도한다(앞쪽 컨테이너는
@@ -163,6 +164,7 @@ test.describe('@layout-editor 동작/표시조건/정렬박스 (S7)', () => {
return false;
}
/** @effects action_tab_visible_when_events */
test('동작 탭 — apiCall 의 성공 시 동작(중첩) add picker 가 코어 핸들러를 노출(빈 상태 금지)', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -14,7 +14,7 @@
* 결선돼 Playwright dispatchEvent 로 검증 가능하다(캔버스 노드 재배치의 dnd-kit 비호환과 별개).
*
* @scenario page_settings_init_actions_reorder
* @effects reorder_buttons_removed + drag_handle_reorders + dropline_shows_target
* 효과 요약(마커 아님 — 평문): reorder_buttons_removed, drag_handle_reorders, dropline_shows_target.
*/
import { test, expect, issueToken, authenticatePage } from '../../fixtures/auth';
@@ -82,6 +82,7 @@ async function cardTitles(page: PwPage): Promise<string[]> {
}
test.describe('@layout-editor 화면 동작 순서 변경 드래그 (S10-1 후속)', () => {
/** @effects reorder_buttons_removed */
test('순서 변경 ▲▼ 버튼 부재 + ⠿ 드래그 핸들 존재 + 삽입선 비활성(초기)', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -98,6 +99,7 @@ test.describe('@layout-editor 화면 동작 순서 변경 드래그 (S10-1 후
await expect(page.locator('[data-testid="g7le-init-action-self-dropline-end"]')).toHaveAttribute('data-active', 'false');
});
/** @effects drag_handle_reorders, dropline_shows_target */
test('⠿ 드래그로 순서 변경 + 드롭 예정 지점 삽입선 활성', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -138,6 +140,7 @@ test.describe('@layout-editor 화면 동작 순서 변경 드래그 (S10-1 후
await expect(page.locator('[data-testid="g7le-init-action-self-dropline-end"]')).toHaveAttribute('data-active', 'false');
});
/** @effects drag_handle_reorders */
test('연속 드래그 — 누적 순서 정합(다시 원래 순서로)', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -14,8 +14,8 @@
* 을 검증한다. 추가/삭제/정렬/필드편집/디그레이드 회귀는 단위(ArrayItemsEditor.test.tsx)가
* 잠그고, 본 E2E 는 라이브 반영·저장을 브라우저로 확인한다.
*
* @scenario array_node_editor + add_item + edit_text_field + live_persist
* @effects property_modal_dispatches_array_node_editor_in_props_tab_by_kind, add_item_appends_newitem_skeleton_patches_whole_node, text_field_updates_item_immediately, live_add_tab_edit_label_reorder_save_persists_to_user_page, editor_save_specs_target_sandbox_layout_not_product_layout
* 축 요약(마커 아님 — 평문): array_node_editor, add_item, edit_text_field, live_persist.
* 효과 요약(마커 아님 — 평문): property_modal_dispatches_array_node_editor_in_props_tab_by_kind, add_item_appends_newitem_skeleton_patches_whole_node, text_field_updates_item_immediately, live_add_tab_edit_label_reorder_save_persists_to_user_page, editor_save_specs_target_sandbox_layout_not_product_layout.
*/
import { test, expect, issueToken, authenticatePage } from '../../fixtures/auth';
import type { Page } from '@playwright/test';
@@ -122,6 +122,7 @@ async function appendTabNavigationTo(page: Page, containerPath: string): Promise
}
test.describe('@layout-editor array 노드 에디터(빌트인 ARRAY-PROP)', () => {
/** @effects property_modal_dispatches_array_node_editor_in_props_tab_by_kind, add_item_appends_newitem_skeleton_patches_whole_node */
test('TabNavigation 선택 시 array 에디터가 속성 탭에 마운트되고 항목 추가가 행 반영', async ({ page }) => {
await gotoEditor(page);
const navPath = await addTabNavigation(page);
@@ -137,6 +138,7 @@ test.describe('@layout-editor array 노드 에디터(빌트인 ARRAY-PROP)', ()
expect(rowsAfter).toBe(rowsBefore + 1);
});
/** @effects text_field_updates_item_immediately */
test('항목 id text 필드 편집이 즉시 반영(입력값 유지)', async ({ page }) => {
await gotoEditor(page);
const navPath = await addTabNavigation(page);
@@ -158,6 +160,7 @@ test.describe('@layout-editor array 노드 에디터(빌트인 ARRAY-PROP)', ()
// 시드 화면(e2e_sandbox)을 대상으로 한다. 이전에는 "추가한 TabNavigation 삭제 후 재저장" 으로
// 원복했으나, 원복 자체가 또 한 번의 저장이라 실패하면 잔여물이 남았다. 시드 화면은 globalSetup 이
// 매 실행 fixture 원본으로 덮어쓰므로 원복 절차가 필요 없다.
/** @effects live_add_tab_edit_label_reorder_save_persists_to_user_page, editor_save_specs_target_sandbox_layout_not_product_layout */
test('array 편집 후 저장 → PUT 200', async ({ page }) => {
test.setTimeout(60_000); // 저장 + 모달 닫힘 대기 합산 — 기본 30s 부족
await gotoEditor(page, sandboxRouteParam());
@@ -20,12 +20,13 @@
* 렌더됐다. 수정: editor-spec sampleGlobal 에 `$locale`/`$locales` 선언 +
* PreviewCanvas 가 `$`-prefixed 키를 렌더 컨텍스트 최상위로 lift.
*
* @scenario editor_entry_unauthorized + editor_entry_authorized + sample_locales_dropdown
* @effects access_error_panel_unauthorized + chrome_not_rendered_when_unauthorized + route_tree_source_tagged + locale_dropdown_populated
* 축 요약(마커 아님 — 평문): editor_entry_unauthorized, editor_entry_authorized, sample_locales_dropdown.
* 효과 요약(마커 아님 — 평문): access_error_panel_unauthorized, chrome_not_rendered_when_unauthorized, route_tree_source_tagged, locale_dropdown_populated.
*/
import { test, expect, issueToken, authenticatePage } from '../../fixtures/auth';
test.describe('@layout-editor 진입 인증 가드', () => {
/** @effects access_error_panel_unauthorized, chrome_not_rendered_when_unauthorized */
test('비로그인(토큰 없음) 진입 시 chrome 미렌더 + unauthorized 안내', async ({ page }) => {
// authenticatePage 미호출 — localStorage 에 auth_token 없음(세션 만료/로그아웃 상태 모사).
await page.goto('/admin/layout-editor/sirsoft-admin_basic?route=%2Flogin');
@@ -41,6 +42,7 @@ test.describe('@layout-editor 진입 인증 가드', () => {
await expect(page.getByTestId('g7le-chrome-header')).toHaveCount(0);
});
/** @effects route_tree_source_tagged */
test('편집 권한 보유 시 정상 진입 (chrome 렌더 + 라우트 트리 source 태깅 정상)', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -59,6 +61,7 @@ test.describe('@layout-editor 진입 인증 가드', () => {
});
test.describe('@layout-editor 샘플 로케일 목록', () => {
/** @effects locale_dropdown_populated */
test('로그인 화면 로케일 선택 드롭다운이 $locales 로 채워진다', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -8,8 +8,8 @@
* 잡지 못해(브라우저 렌더만이 포착), Playwright 로 실제 캔버스 DOM 의 inline
* `background-image: url(...)` 적용을 검증한다.
*
* @scenario background_image_apply + background_image_mode_switch
* @effects canvas_background_image_url + canvas_background_size_mode
* 축 요약(마커 아님 — 평문): background_image_apply, background_image_mode_switch.
* 효과 요약(마커 아님 — 평문): canvas_background_image_url, canvas_background_size_mode.
*/
import { test, expect, issueToken, authenticatePage } from '../../fixtures/auth';
import type { Page } from '@playwright/test';
@@ -58,6 +58,7 @@ async function openStyleTab(page: Page): Promise<void> {
}
test.describe('@layout-editor 배경 이미지 캔버스 반영', () => {
/** @effects canvas_background_image_url */
test('속성 모달 image 위젯 → URL 입력 → 캔버스 노드 inline background-image url(...) 반영', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -104,6 +105,7 @@ test.describe('@layout-editor 배경 이미지 캔버스 반영', () => {
expect(styleSnap.repeat).toBe('no-repeat');
});
/** @effects canvas_background_size_mode */
test('표시 모드 전환(맞춤/타일) → 캔버스 backgroundSize/Repeat 정합', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -12,7 +12,7 @@
* 마운트 성공이 곧 단일 React 인스턴스 + 컨텍스트/싱글톤 동일성(shim __runtime 공유)을 증명한다.
*
* @scenario bundle_split_lazy_editor
* @effects editor_bundle_absent_on_normal_page + editor_bundle_loaded_and_mounted_on_editor_route
* 효과 요약(마커 아님 — 평문): editor_bundle_absent_on_normal_page, editor_bundle_loaded_and_mounted_on_editor_route.
*/
import { test, expect, issueToken, authenticatePage } from '../../fixtures/auth';
@@ -37,6 +37,7 @@ function collectEditorBundleRequests(page: PwPage): string[] {
}
test.describe('Layout Editor — 번들 분리 (lazy 로드)', () => {
/** @effects editor_bundle_absent_on_normal_page */
test('일반 admin 페이지는 layout-editor.min.js 를 요청하지 않는다', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -50,6 +51,7 @@ test.describe('Layout Editor — 번들 분리 (lazy 로드)', () => {
expect(editorRequests, '일반 페이지에서 편집기 번들이 로드됨(회귀)').toEqual([]);
});
/** @effects editor_bundle_loaded_and_mounted_on_editor_route */
test('편집기 URL 진입 시 layout-editor.min.js 를 로드하고 마운트한다', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -14,8 +14,8 @@
* 를 검증한다. 항목 텍스트 다국어(커스텀 키 생성)는 단위(ChildrenListControl.test.tsx)가
* CRUD round-trip 을 잠그고, 본 E2E 는 구조 편집(추가/정렬/저장)을 브라우저로 확인한다.
*
* @scenario children_node_editor + add_remove_move + live_persist
* @effects property_modal_dispatches_children_node_editor_in_props_tab_by_kind_not_name, add_item_appends_childcomponent_defaultnode_to_children, move_up_down_swaps_adjacent_children_with_boundary_guard, live_add_li_edit_text_reorder_save_persists_to_user_page, keyboard_arrowup_escape_escalates_selection_to_parent, overlapping_child_selected_type_chip_escalates_to_parent, editor_save_specs_target_sandbox_layout_not_product_layout, editor_save_persists_and_survives_reload_on_sandbox
* 축 요약(마커 아님 — 평문): children_node_editor, add_remove_move, live_persist.
* 효과 요약(마커 아님 — 평문): property_modal_dispatches_children_node_editor_in_props_tab_by_kind_not_name, add_item_appends_childcomponent_defaultnode_to_children, move_up_down_swaps_adjacent_children_with_boundary_guard, live_add_li_edit_text_reorder_save_persists_to_user_page, keyboard_arrowup_escape_escalates_selection_to_parent, overlapping_child_selected_type_chip_escalates_to_parent, editor_save_specs_target_sandbox_layout_not_product_layout, editor_save_persists_and_survives_reload_on_sandbox.
*/
import { test, expect, issueToken, authenticatePage } from '../../fixtures/auth';
import type { Page } from '@playwright/test';
@@ -127,6 +127,7 @@ async function appendUlTo(page: Page, containerPath: string): Promise<string> {
}
test.describe('@layout-editor children 노드 에디터(목록 빌트인)', () => {
/** @effects property_modal_dispatches_children_node_editor_in_props_tab_by_kind_not_name, add_item_appends_childcomponent_defaultnode_to_children, move_up_down_swaps_adjacent_children_with_boundary_guard */
test('Ul 선택 시 children 에디터가 속성 탭에 마운트되고 Li 추가/정렬이 캔버스 반영', async ({ page }) => {
await gotoEditor(page);
const ulPath = await addUl(page);
@@ -167,6 +168,7 @@ test.describe('@layout-editor children 노드 에디터(목록 빌트인)', () =
// 시드 화면(e2e_sandbox)을 대상으로 한다. 이전에는 "추가한 Ul 삭제 후 재저장" 으로 원복했으나,
// 원복 자체가 또 한 번의 저장이라 실패하면 잔여물이 남았다. 시드 화면은 globalSetup 이 매 실행
// fixture 원본으로 덮어쓰므로 원복 절차가 필요 없다.
/** @effects live_add_li_edit_text_reorder_save_persists_to_user_page, editor_save_specs_target_sandbox_layout_not_product_layout, editor_save_persists_and_survives_reload_on_sandbox */
test('children 편집 후 저장 → PUT 200 + reload 영속', async ({ page }) => {
test.setTimeout(60_000); // 저장 + reload 합산 — 기본 30s 부족
@@ -213,6 +215,7 @@ test.describe('@layout-editor children 노드 에디터(목록 빌트인)', () =
// 겹친 부모 선택 — 캔버스 클릭은 늘 가장 깊은 자식을 잡으므로(closest), 부모/자식 크기가
// 같은 Ul>Li 같은 경우 자식만 잡힌다. 선택 박스 위 타입 칩(↑)을 클릭하거나 키보드 ↑/Esc 로
// 한 단계씩 상위(부모)를 선택한다(상용 편집기 공통 — 부모는 별도 어포던스).
/** @effects keyboard_arrowup_escape_escalates_selection_to_parent, overlapping_child_selected_type_chip_escalates_to_parent */
test('겹친 자식 선택 후 타입 칩(↑)/키보드 ↑로 부모(Ul) escalation', async ({ page }) => {
await gotoEditor(page);
const ulPath = await addUl(page);
@@ -12,8 +12,8 @@
* 레이아웃이므로 템플릿 자체 E2E(templates/_bundled/sirsoft-admin_basic/tests/Playwright)
* 가 커버한다 — 본 코어 spec 은 위지윅 chrome 책임만.
*
* @scenario preview_device + custom_width_input + toolbar_action + selected_box_size + affordance_kind + mobile_closed_drawer_clipping + route_tree_node_source_kind
* @effects preview_custom_device_uses_clamped_input_width_as_override + toolbar_exit_navigates_to_template_list_by_type + toolbar_edit_code_opens_text_layout_editor_in_new_window_with_route + toolbar_save_shows_spinner_while_pending_then_restores + insertion_affordances_cross_layout_when_box_lt_44_no_overlap_no_clip + mobile_preview_closed_drawer_clipped_inside_frame_not_visible + route_tree_item_shows_layout_file_path_under_label_with_source_prefix
* 축 요약(마커 아님 — 평문): preview_device, custom_width_input, toolbar_action, selected_box_size, affordance_kind, mobile_closed_drawer_clipping, route_tree_node_source_kind.
* 효과 요약(마커 아님 — 평문): preview_custom_device_uses_clamped_input_width_as_override, toolbar_exit_navigates_to_template_list_by_type, toolbar_edit_code_opens_text_layout_editor_in_new_window_with_route, toolbar_save_shows_spinner_while_pending_then_restores, insertion_affordances_cross_layout_when_box_lt_44_no_overlap_no_clip, mobile_preview_closed_drawer_clipped_inside_frame_not_visible, route_tree_item_shows_layout_file_path_under_label_with_source_prefix.
*/
import { test, expect, issueToken, authenticatePage } from '../../fixtures/auth';
@@ -30,6 +30,7 @@ async function enterEditor(page: import('@playwright/test').Page): Promise<void>
}
test.describe('@layout-editor chrome controls', () => {
/** @effects preview_custom_device_uses_clamped_input_width_as_override */
test('결함 2 — custom 디바이스 선택 시 width 입력 노출 + 프레임 폭 반영', async ({ page }) => {
await enterEditor(page);
@@ -50,6 +51,7 @@ test.describe('@layout-editor chrome controls', () => {
.toBe(500);
});
/** @effects toolbar_exit_navigates_to_template_list_by_type */
test('결함 4 — 나가기 버튼 클릭 시 user 템플릿 목록(/admin/templates/user)으로 이탈', async ({ page }) => {
// sirsoft-basic 은 user 템플릿 → 나가기 목적지는 /admin/templates/user
await enterEditor(page);
@@ -60,6 +62,7 @@ test.describe('@layout-editor chrome controls', () => {
expect(page.url()).toMatch(/\/admin\/templates\/user/);
});
/** @effects toolbar_edit_code_opens_text_layout_editor_in_new_window_with_route */
test('결함 5 — 코드편집 버튼 클릭 시 선택 route 를 ?route= 로 실어 새 창으로 연다', async ({ page, context }) => {
// EDITOR_URL 은 ?route=%2F (홈) 선택 상태 → 코드편집기를 새 창(_blank)으로 열고
// ?route=/ 동기화. 위지윅 편집 화면(page)은 그대로 유지된다.
@@ -95,6 +98,7 @@ test.describe('@layout-editor chrome controls', () => {
await expect(page.getByTestId('g7le-palette-item-Button-tag')).toHaveText('<Button>');
});
/** @effects route_tree_item_shows_layout_file_path_under_label_with_source_prefix */
test('후속 — 좌측 트리 라우트 노드에 레이아웃 파일 경로가 라벨 하단에 노출 (출처 prefix)', async ({ page }) => {
// sirsoft-basic 은 템플릿 소스 → 경로 표기는 "layouts/{layoutName}.json".
// 트리의 라우트 항목마다 라벨 아래 회색 보조 줄(g7le-route-tree-layout-path)이
@@ -133,6 +137,7 @@ test.describe('@layout-editor chrome controls', () => {
expect(result.groupHasPath).toBe(false);
});
/** @effects insertion_affordances_cross_layout_when_box_lt_44_no_overlap_no_clip */
test('결함 7 재조사 — 작은 요소 선택 시 삽입 어포던스가 박스 중심 십자로 비겹침·비잘림', async ({ page }) => {
// 인라인 텍스트(Span) 추가 → 작은 박스(폭<44) 선택 → 4방향 + 버튼이 박스
// 중심 기준 위/아래/좌/우 십자로 벌어져 서로/박스와 겹치지 않고, 캔버스에도
@@ -206,6 +211,7 @@ test.describe('@layout-editor chrome controls', () => {
expect(geom.leftRightSameCy).toBe(true);
});
/** @effects mobile_preview_closed_drawer_clipped_inside_frame_not_visible */
test('회귀 — 모바일 프리뷰의 닫힌 메뉴 드로어가 frame 밖으로 노출되지 않는다', async ({ page }) => {
// 닫힌 모바일 드로어(mobile_nav_drawer)는 `position: fixed` + `translate-x-full`
// 로 화면 밖에 밀려 있어야 한다. frame 이 자체 transform 을 잃으면 fixed 자손의
@@ -19,8 +19,8 @@
* dnd-kit 비호환(feedback_chrome_mcp_dnd_kit_incompatible) 회피 — 노드 선택은 합성 마우스
* 이벤트 시퀀스로 드래그 핸들 pointer 가로채기를 우회한다.
*
* @scenario property_modal_visibility_preset_recognition + visibility_compound_stays_advanced + numeric_array_preset_recognition + explicit_boolean_compare_preset_recognition + comparison_pattern_preset_recognition + coverage_gate_presets_served
* @effects visibility_builder_renders + variant_defense_no_false_positive + stage2_numeric_array_presets_served + stage3_boolean_compare_presets_served + stage4_comparison_presets_served + stage5_gate_presets_served
* 축 요약(마커 아님 — 평문): property_modal_visibility_preset_recognition, visibility_compound_stays_advanced, numeric_array_preset_recognition, explicit_boolean_compare_preset_recognition, comparison_pattern_preset_recognition, coverage_gate_presets_served.
* 효과 요약(마커 아님 — 평문): visibility_builder_renders, variant_defense_no_false_positive, stage2_numeric_array_presets_served, stage3_boolean_compare_presets_served, stage4_comparison_presets_served, stage5_gate_presets_served.
*/
import { test, expect, issueToken, authenticatePage } from '../../fixtures/auth';
@@ -83,6 +83,7 @@ async function openVisibilityTab(page: PwPage, path: string): Promise<boolean> {
}
test.describe('@layout-editor 표시조건 변종 방어 인프라 (단계 0)', () => {
/** @effects visibility_builder_renders */
test('표시조건 탭이 빌더 또는 no-recipes 로 렌더 (인프라 배선 회귀 가드)', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -110,6 +111,7 @@ test.describe('@layout-editor 표시조건 변종 방어 인프라 (단계 0)',
expect(opened).toBe(true);
});
/** @effects stage2_numeric_array_presets_served */
test('P2/P3 operator 가 served editor-spec 에 노출 + 숫자/배열 패턴 인식', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -136,6 +138,7 @@ test.describe('@layout-editor 표시조건 변종 방어 인프라 (단계 0)',
}
});
/** @effects stage3_boolean_compare_presets_served */
test('P5 valueIsTrue/valueIsFalse 가 served editor-spec 에 노출', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -166,6 +169,7 @@ test.describe('@layout-editor 표시조건 변종 방어 인프라 (단계 0)',
}
});
/** @effects stage4_comparison_presets_served */
test('단계 4 비교 패턴 operator 가 served editor-spec 에 노출', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -197,6 +201,7 @@ test.describe('@layout-editor 표시조건 변종 방어 인프라 (단계 0)',
}
});
/** @effects stage5_gate_presets_served */
test('60% 게이트 토대 프리셋 18종이 양 템플릿 served editor-spec 에 전부 노출', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -231,6 +236,7 @@ test.describe('@layout-editor 표시조건 변종 방어 인프라 (단계 0)',
}
});
/** @effects variant_defense_no_false_positive */
test('콘솔/네트워크 에러 없이 표시조건 모달 진입 (variant-defense 무결성)', async ({ page }) => {
const consoleErrors: string[] = [];
page.on('console', (msg) => {
@@ -14,10 +14,10 @@
* - sirsoft-basic: Button → rounded-lg, Input → border 패턴
* - sirsoft-admin_basic: Button → bg-blue-600, Input → "input" 유틸 클래스
*
* @scenario palette_open + default_node_source:editorSpecDefaultNode
* @effects palette_default_node_className_replicated_into_inserted_node
* @effects palette_default_node_className_reflects_template_design_system_tokens
* @effects palette_default_node_button_omits_variant_size_uses_className_only
* 축 요약(마커 아님 — 평문): palette_open, default_node_source:editorSpecDefaultNode.
* 효과 요약(마커 아님 — 평문): palette_default_node_className_replicated_into_inserted_node.
* 효과 요약(마커 아님 — 평문): palette_default_node_className_reflects_template_design_system_tokens.
* 효과 요약(마커 아님 — 평문): palette_default_node_button_omits_variant_size_uses_className_only.
*/
import { test, expect, issueToken, authenticatePage } from '../../fixtures/auth';
@@ -32,6 +32,7 @@ const probes: Probe[] = [
test.describe('@layout-editor defaultNode 공통 디자인 반영', () => {
for (const { template, component, token } of probes) {
/** @effects palette_default_node_className_replicated_into_inserted_node, palette_default_node_className_reflects_template_design_system_tokens, palette_default_node_button_omits_variant_size_uses_className_only */
test(`${template} — ${component} 추가 시 캔버스에 "${token}" className 반영`, async ({ page }) => {
const tokenAuth = issueToken('core.templates.layouts.edit');
await authenticatePage(page, tokenAuth);
@@ -22,7 +22,7 @@
* 슬롯 레벨 한정(자기 자손·래퍼 밖 break-out 슬롯 부재).
*
* @scenario drag_drop reorder
* @effects drag_handle_present_for_draggable + explicit_drop_slots_render + drop_slots_scoped_to_relevant_levels + editor_attrs_passthrough_marks_nesting_nodes + drop_slots_span_all_accepting_containers + handle_zindex_depth_ordered + selection_based_drag_substitution + child_reselect_under_selected_parent + inner_child_nests_into_sibling_filled_card + nav_destination_unreachable_affordance_hidden + data_bound_node_draggable_and_selectable + iteration_instance_not_individually_draggable + iteration_virtual_group_select_move_ghost
* 효과 요약(마커 아님 — 평문): drag_handle_present_for_draggable, explicit_drop_slots_render, drop_slots_scoped_to_relevant_levels, editor_attrs_passthrough_marks_nesting_nodes, drop_slots_span_all_accepting_containers, handle_zindex_depth_ordered, selection_based_drag_substitution, child_reselect_under_selected_parent, inner_child_nests_into_sibling_filled_card, nav_destination_unreachable_affordance_hidden, data_bound_node_draggable_and_selectable, iteration_instance_not_individually_draggable, iteration_virtual_group_select_move_ghost.
*/
import type { Page } from '@playwright/test';
import { test, expect, issueToken, authenticatePage } from '../../fixtures/auth';
@@ -104,6 +104,7 @@ test.describe('@layout-editor drag-drop reorder', () => {
}).catch(() => { /* 페이지 닫힘 등 무시 */ });
});
/** @effects drag_handle_present_for_draggable */
test('드래그 핸들이 draggable 노드에만 렌더된다', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -126,6 +127,7 @@ test.describe('@layout-editor drag-drop reorder', () => {
expect(mapped, '모든 일반 드래그 핸들이 실제 editor-path 노드에 매핑되어야 함').toBe(true);
});
/** @effects explicit_drop_slots_render */
test('드래그 중 고스트가 body 포털 + 실제 컴포넌트 복제 + 커서 정합, 드롭 슬롯 표시', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -184,6 +186,7 @@ test.describe('@layout-editor drag-drop reorder', () => {
expect(slotsAfter, '드롭 후 슬롯은 사라져야 함').toBe(0);
});
/** @effects drop_slots_scoped_to_relevant_levels */
test('드롭 슬롯이 드래그 노드의 관련 레벨로 한정 — 자기 자손/래퍼 밖 break-out 슬롯 없음', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -252,6 +255,7 @@ test.describe('@layout-editor drag-drop reorder', () => {
* 본 테스트는 stat 카드(composite StatCard)와 그 조상 컨테이너(layout)가 모두
* [data-editor-path] 로 잡히는지 확인 — editorAttrs 가 composite/layout 루트에 도달했다는 증거.
*/
/** @effects editor_attrs_passthrough_marks_nesting_nodes */
test('composite/layout nesting 노드가 editorAttrs spread 로 [data-editor-path] 표식을 보유', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -299,6 +303,7 @@ test.describe('@layout-editor drag-drop reorder', () => {
* 드래그 시작하면 그 노드의 **부모가 아닌 다른 컨테이너**에도 드롭 슬롯이 생성된다.
* (이전: 부모/직접 형제만 슬롯 → 다른 컨테이너로 못 넣음.)
*/
/** @effects drop_slots_span_all_accepting_containers */
test('드롭 슬롯이 드래그 노드의 부모 외 다른 컨테이너에도 생성 (결함 1: 컨테이너 간 이동)', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -344,6 +349,7 @@ test.describe('@layout-editor drag-drop reorder', () => {
* z 를 낮추면 부모 핸들이 자식 영역을 덮어 "부모 선택 상태에서 자식 재선택 불가" 결함이
* 났다. 검증: 부모-자식 핸들 쌍에서 자식 z > 부모 z.
*/
/** @effects handle_zindex_depth_ordered */
test('드래그 핸들 z-index 가 트리 깊이순 — 자식이 부모보다 위 (결함 2: 클릭 우선순위)', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -384,6 +390,7 @@ test.describe('@layout-editor drag-drop reorder', () => {
* 노드로 치환), (b) 자식을 단순 클릭하면 자식이 재선택된다. 검증: 부모 선택 후 자식 영역에서
* 드래그 시작 시 부모 자기/자손 컨테이너 슬롯이 제외됨(=부모가 드래그 대상으로 치환된 증거).
*/
/** @effects selection_based_drag_substitution, child_reselect_under_selected_parent */
test('부모 선택 후 자식 영역 드래그 → 선택 부모가 끌림 + 자식 클릭 시 재선택 (결함 2: 선택 기준 드래그)', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -481,6 +488,7 @@ test.describe('@layout-editor drag-drop reorder', () => {
* 으로 확장했다. 검증: 카드 내부 자식을 드래그 시작하면 **형제 카드(또는 그 자손)에 드롭 슬롯**
* 이 생성된다(아이콘을 다른 카드로 옮길 수 있음).
*/
/** @effects inner_child_nests_into_sibling_filled_card */
test('카드 내부 자식을 드래그하면 형제(채워진) 카드에 드롭 슬롯 생성', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -536,6 +544,7 @@ test.describe('@layout-editor drag-drop reorder', () => {
* 선택해도 "편집기에서 이동할 수 없습니다" 안내(destination_unreachable)는 표시되지
* 않는다. 어차피 편집기에서 미작동하므로 어포던스 자체를 제거(드래그 재배치 오해 방지).
*/
/** @effects nav_destination_unreachable_affordance_hidden */
test('네비 어포던스 미표시 — destination_unreachable 어포던스가 DOM 에 없음', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -560,6 +569,7 @@ test.describe('@layout-editor drag-drop reorder', () => {
* sirsoft-basic home 에는 data_bound composite 가 적을 수 있어, "핸들이 달린
* data_bound 노드가 1개 이상 존재"로 확인(없으면 skip 처리하지 않고 핸들↔노드 매핑만).
*/
/** @effects data_bound_node_draggable_and_selectable */
test('data_bound 요소도 드래그 핸들을 가져 선택/이동 가능', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -580,6 +590,7 @@ test.describe('@layout-editor drag-drop reorder', () => {
* iteration 펼침 인스턴스(`...iteration.N`)와 그 내부 노드는 **개별** 드래그 핸들을
* 갖지 않는다 — 개별 인스턴스를 직접 옮기면 안 되기 때문(묶음은 아래 가상 묶음으로).
*/
/** @effects iteration_instance_not_individually_draggable */
test('반복 인스턴스/내부 노드는 개별 드래그 핸들 미생성', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -613,6 +624,7 @@ test.describe('@layout-editor drag-drop reorder', () => {
* iteration 원본 path 로 1개, box 는 인스턴스 union. 클릭 시 묶음 union 이 선택되고,
* 드래그 시작 시 원본 노드가 드래그 대상(자기/자손 슬롯 제외) + 고스트 표시.
*/
/** @effects iteration_virtual_group_select_move_ghost */
test('이터레이션 가상 묶음 — 묶음 핸들 생성 + union 선택 + 원본 노드 드래그 + 고스트', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -16,8 +16,8 @@
* PasswordInput.test.tsx 가 data-editor-* 루트 부착을 잠근다. 본 Playwright 는 실제 편집기
* 팔레트 필터 연동 + propControl→DOM 라운드트립을 브라우저로 검증한다.
*
* @scenario empty_container_first_child + form_propcontrol_edit
* @effects empty_container_global_palette_filters_by_own_accepts_not_parent + palette_filters_by_parent_accepts
* 축 요약(마커 아님 — 평문): empty_container_first_child, form_propcontrol_edit.
* 효과 요약(마커 아님 — 평문): empty_container_global_palette_filters_by_own_accepts_not_parent, palette_filters_by_parent_accepts.
*/
import { test, expect, issueToken, authenticatePage } from '../../fixtures/auth';
import type { Page } from '@playwright/test';
@@ -92,6 +92,7 @@ async function addEmptyDiv(page: Page): Promise<string> {
}
test.describe('@layout-editor 빈 컨테이너 첫 자식 + 폼 propControl', () => {
/** @effects empty_container_global_palette_filters_by_own_accepts_not_parent, palette_filters_by_parent_accepts */
test('빈 Div 선택 시 팔레트가 그 Div 의 accepts(폼 포함)로 필터된다 (결함#1)', async ({ page }) => {
await gotoEditor(page);
@@ -8,8 +8,8 @@
* E. text 미보유/데이터 결정 노드 → 더블클릭해도 인라인 편집 비활성(편집기 미노출).
* F. 속성 모달 [번역] 탭 — 커스텀 키 노드는 로케일별 일괄 편집 폼, 평문은 "키 아님" 안내.
*
* @scenario locale_switch_canvas_only + inline_edit_existing_key_to_new_custom_key + inline_edit_real_mouse_via_dnd_handle + canvas_renders_value_not_raw_key + inline_edit_disabled_binding + toolbar_spec_based + translation_tab_bulk_edit
* @effects locale_switcher_changes_only_canvas_content_locale_not_chrome + inline_edit_plain_text_generates_custom_key_via_post_endpoint + inline_edit_replaces_comp_text_with_t_custom_key + inline_edit_real_mouse_double_click_via_dnd_handle_forward + canvas_rerenders_custom_key_value_after_server_lang_refetch + inline_edit_disabled_for_binding_expression_text + inline_toolbar_buttons_filtered_by_componentCapability_styleControls + inline_toolbar_omits_list_table_image_buttons + translation_field_displays_all_active_locales_in_modal
* 축 요약(마커 아님 — 평문): locale_switch_canvas_only, inline_edit_existing_key_to_new_custom_key, inline_edit_real_mouse_via_dnd_handle, canvas_renders_value_not_raw_key, inline_edit_disabled_binding, toolbar_spec_based, translation_tab_bulk_edit.
* 효과 요약(마커 아님 — 평문): locale_switcher_changes_only_canvas_content_locale_not_chrome, inline_edit_plain_text_generates_custom_key_via_post_endpoint, inline_edit_replaces_comp_text_with_t_custom_key, inline_edit_real_mouse_double_click_via_dnd_handle_forward, canvas_rerenders_custom_key_value_after_server_lang_refetch, inline_edit_disabled_for_binding_expression_text, inline_toolbar_buttons_filtered_by_componentCapability_styleControls, inline_toolbar_omits_list_table_image_buttons, translation_field_displays_all_active_locales_in_modal.
*/
import { test, expect, issueToken, authenticatePage } from '../../fixtures/auth';
import type { Page } from '@playwright/test';
@@ -67,6 +67,7 @@ async function selectNode(page: Page, editorPath: string): Promise<void> {
}
test.describe('@layout-editor 다국어 인라인 편집 (Phase 6 S8-2)', () => {
/** @effects locale_switcher_changes_only_canvas_content_locale_not_chrome */
test('A. 로케일 전환 — 캔버스 콘텐츠 로케일만 변경(편집기 chrome 불변)', async ({ page }) => {
await openEditorLogin(page);
// 로케일 스위처가 노출되면(활성 로케일 2개 이상) 전환 동작 검증, 1개면 단일 라벨.
@@ -88,6 +89,7 @@ test.describe('@layout-editor 다국어 인라인 편집 (Phase 6 S8-2)', () =>
}
});
/** @effects inline_edit_plain_text_generates_custom_key_via_post_endpoint, inline_edit_replaces_comp_text_with_t_custom_key, inline_edit_real_mouse_double_click_via_dnd_handle_forward, canvas_rerenders_custom_key_value_after_server_lang_refetch */
test('B+C+D. 기존 $t: 키 텍스트 더블클릭(실제 마우스) → 인라인 편집기 → Enter 확정 → POST 키 생성 → 캔버스가 raw 키가 아닌 입력값 표시', async ({ page }) => {
await openEditorLogin(page);
@@ -126,6 +128,7 @@ test.describe('@layout-editor 다국어 인라인 편집 (Phase 6 S8-2)', () =>
.toBe('환영 인사 변경');
});
/** @effects inline_toolbar_buttons_filtered_by_componentCapability_styleControls, inline_toolbar_omits_list_table_image_buttons */
test('D. 서식 툴바 — styleControls 기반 버튼만, 목록/표/이미지 버튼 부재', async ({ page }) => {
await openEditorLogin(page);
await dblClickNode(page, HEADING);
@@ -140,6 +143,7 @@ test.describe('@layout-editor 다국어 인라인 편집 (Phase 6 S8-2)', () =>
}
});
/** @effects inline_edit_disabled_for_binding_expression_text */
test('E. 바인딩식/데이터 결정 노드 → 더블클릭해도 인라인 편집 미진입', async ({ page }) => {
await openEditorLogin(page);
// 카드 전체(Div, text 없음) 더블클릭 → 편집기 미노출(편집 불가 노드).
@@ -150,6 +154,7 @@ test.describe('@layout-editor 다국어 인라인 편집 (Phase 6 S8-2)', () =>
await expect(page.getByTestId('g7le-inline-text-editable')).toHaveCount(0);
});
/** @effects translation_field_displays_all_active_locales_in_modal */
test('F. 속성 모달 [번역] 탭 — 평문 노드는 "키 아님" 안내', async ({ page }) => {
await openEditorLogin(page);
await selectNode(page, HEADING);
@@ -4,8 +4,8 @@
* 반복 항목(iteration_item) 편집 모드의 4종을 브라우저에서 가드한다. 단위 테스트는
* URL pushState/popstate, 오버레이 레이어 hit-test, 캐시 무효화→재fetch render-cycle 을 모사 못 함.
*
* @scenario iteration_edit_entry + save_invalidation + exit_return + inline_double_click + lock_visibility
* @effects url_direct_entry_renders_iteration_mode_with_host + exit_iteration_edit_returns_to_host_route + iteration_save_invalidates_host_route_cache_and_busts_get + double_click_plain_text_enters_inline_edit + data_bound_node_shows_data_area_notice
* 축 요약(마커 아님 — 평문): iteration_edit_entry, save_invalidation, exit_return, inline_double_click, lock_visibility.
* 효과 요약(마커 아님 — 평문): url_direct_entry_renders_iteration_mode_with_host, exit_iteration_edit_returns_to_host_route, iteration_save_invalidates_host_route_cache_and_busts_get, double_click_plain_text_enters_inline_edit, data_bound_node_shows_data_area_notice.
*/
import { test, expect, issueToken, authenticatePage } from '../../fixtures/auth';
import { editorPath as resolveEditorPath } from '../../fixtures/layout-editor';
@@ -44,6 +44,7 @@ async function gotoIterationEdit(page: import('@playwright/test').Page): Promise
test.describe('@layout-editor 반복 항목 편집 — 저장/복귀/인라인/잠금가시', () => {
// URL 다이렉트 진입 시 반복 항목 편집 모드 + 호스트(인기글) 인플레이스 렌더.
/** @effects url_direct_entry_renders_iteration_mode_with_host */
test('URL 다이렉트 진입 → iteration_item 모드 + 호스트 렌더', async ({ page }) => {
await gotoIterationEdit(page);
await expect(page.locator('[data-mode="iteration_item"]')).toBeAttached({ timeout: 20_000 });
@@ -54,6 +55,7 @@ test.describe('@layout-editor 반복 항목 편집 — 저장/복귀/인라인/
});
// 편집 종료 시 호스트 라우트로 복귀("라우트 선택" 화면 회귀 방지).
/** @effects exit_iteration_edit_returns_to_host_route */
test('편집 종료 → 호스트 라우트(?route=/boards/popular)로 복귀', async ({ page }) => {
await gotoIterationEdit(page);
// "반복 항목 편집 종료" 버튼.
@@ -67,6 +69,7 @@ test.describe('@layout-editor 반복 항목 편집 — 저장/복귀/인라인/
// 렌더된 텍스트만으로는 평문/바인딩을 구분할 수 없으므로(렌더 결과엔 중괄호가 없음 — 인기글
// 카드는 전부 바인딩), 불변식은 "인라인 편집기(contenteditable) 또는 데이터 영역 안내 중
// 하나가 반드시 뜬다"로 가드한다(평문→인라인 D-33 / 바인딩→안내 D-34, 무반응이면 실패).
/** @effects double_click_plain_text_enters_inline_edit */
test('항목 안 텍스트 더블클릭 → 인라인 편집 또는 데이터 영역 안내(무반응 금지)', async ({ page }) => {
await gotoIterationEdit(page);
const found = await page.evaluate((srcPath) => {
@@ -93,6 +96,7 @@ test.describe('@layout-editor 반복 항목 편집 — 저장/복귀/인라인/
// 항목 안 데이터 바인딩 노드 선택 시 "데이터 영역은 직접 편집할 수 없습니다" 안내 표시
// (일반 편집기와 동일 가시). iteration 범위 안이라고 무반응이면 안 된다.
/** @effects data_bound_node_shows_data_area_notice */
test('데이터 바인딩 노드 선택 → "데이터 영역" 안내 표시', async ({ page }) => {
await gotoIterationEdit(page);
// 바인딩 텍스트(제목 등) 좌표 클릭.
@@ -14,12 +14,13 @@
* 본 spec 은 실제 브라우저 DOM 에서 중복 id 0 + 미보간 리터럴 0 을 잠근다(단위/시뮬레이션은
* 보간 부재로 인한 reconciliation 합쳐짐을 포착하지 못해 실측이 필수 — feedback #238 계열).
*
* @scenario admin_dashboard_render + layout_editor_core_id_chip
* @effects html_id_unique_no_duplicates + no_uninterpolated_literal_id + core_id_chip_affordance
* 축 요약(마커 아님 — 평문): admin_dashboard_render, layout_editor_core_id_chip.
* 효과 요약(마커 아님 — 평문): html_id_unique_no_duplicates, no_uninterpolated_literal_id, core_id_chip_affordance.
*/
import { test, expect, issueToken, authenticatePage } from '../../fixtures/auth';
test.describe('@layout-editor iteration id 유일성', () => {
/** @effects html_id_unique_no_duplicates, no_uninterpolated_literal_id */
test('관리자 대시보드 렌더 시 HTML id 중복 0 + 미보간 리터럴 0', async ({ page }) => {
const token = issueToken(
'core.dashboard.read',
@@ -67,6 +68,7 @@ test.describe('@layout-editor iteration id 유일성', () => {
expect(report.duplicates, `중복 HTML id: ${report.duplicates.join(', ')}`).toEqual([]);
});
/** @effects core_id_chip_affordance */
test('레이아웃 편집기 요소 ID 칸에 데이터 칩 진입점(BindingChipTextInput) 노출', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -17,7 +17,7 @@
* 콘텐츠로 보존한다.
*
* @scenario selected_node_state=extension_locked_selected,data_bound_selected
* @effects locked_node_shows_insertion_plus_via_anchor + insertion_inserts_outside_locked_group_as_sibling
* 효과 요약(마커 아님 — 평문): locked_node_shows_insertion_plus_via_anchor, insertion_inserts_outside_locked_group_as_sibling.
*/
import type { Page } from '@playwright/test';
import { test, expect, issueToken, authenticatePage } from '../../fixtures/auth';
@@ -94,6 +94,7 @@ async function selectByText(page: Page, matcher: string, maxLen: number): Promis
}
test.describe('@layout-editor 잠긴 영역 요소 추가(+) 복원', () => {
/** @effects locked_node_shows_insertion_plus_via_anchor */
test('확장 주입 조각 선택 → 잠금이어도 + 버튼이 조각 박스 경계에 화면 내 노출', async ({ page }) => {
await openRegisterEditor(page);
const res = await selectByText(page, '마케팅 동의|광고성 이메일', 30);
@@ -105,6 +106,7 @@ test.describe('@layout-editor 잠긴 영역 요소 추가(+) 복원', () => {
expect(res.enabledInViewCount as number).toBeGreaterThan(0);
});
/** @effects locked_node_shows_insertion_plus_via_anchor */
test('데이터 반복(인기글/최근글) 영역 선택 → data_bound 여도 + 버튼이 화면 내 노출', async ({ page }) => {
await openHomeEditor(page);
const res = await selectByText(page, '최근 게시글|샘플 게시글|게시글', 30);
@@ -15,8 +15,8 @@
* 세 번째 케이스(클리핑 차단)는 이 수정의 회귀 가드가 아니라 그 **전제**를 잠근다 — 상세는
* 해당 테스트 주석 참조.
*
* @scenario editor_min_width + narrow_viewport_no_squish + horizontal_scroll
* @effects shell_keeps_min_width_below_viewport, toolbar_items_keep_natural_width_no_wrap, narrow_window_produces_horizontal_scroll_not_compression
* 축 요약(마커 아님 — 평문): editor_min_width, narrow_viewport_no_squish, horizontal_scroll.
* 효과 요약(마커 아님 — 평문): shell_keeps_min_width_below_viewport, toolbar_items_keep_natural_width_no_wrap, narrow_window_produces_horizontal_scroll_not_compression.
*/
import { test, expect, issueToken, authenticatePage } from '../../fixtures/auth';
import type { Page } from '@playwright/test';
@@ -36,6 +36,7 @@ async function gotoEditor(page: Page, route = '%2F'): Promise<void> {
}
test.describe('레이아웃 편집기 — 좁은 창 압착 차단', () => {
/** @effects shell_keeps_min_width_below_viewport */
test('좁은 창에서도 셸이 최소 너비를 유지한다 (압착 없음)', async ({ page }) => {
await page.setViewportSize({ width: NARROW_WIDTH, height: 900 });
await gotoEditor(page);
@@ -47,6 +48,7 @@ test.describe('레이아웃 편집기 — 좁은 창 압착 차단', () => {
expect(shellWidth).toBeGreaterThanOrEqual(EDITOR_MIN_WIDTH);
});
/** @effects toolbar_items_keep_natural_width_no_wrap */
test('좁은 창에서 툴바 항목이 깎이거나 줄바꿈되지 않는다', async ({ page }) => {
// 넓은 창에서 각 툴바 항목의 자연 폭·높이를 먼저 측정한다.
await page.setViewportSize({ width: 1600, height: 900 });
@@ -69,6 +71,7 @@ test.describe('레이아웃 편집기 — 좁은 창 압착 차단', () => {
// 이 케이스가 잠그는 것은 별개의 전제다: 넘친 폭이 `overflow-x: hidden` 으로 **잘리지 않고**
// 스크롤로 접근 가능해야 최소 너비 설계가 성립한다. 호스트/템플릿 CSS 가 나중에 body 나
// #app 에 overflow-x:hidden 을 걸면 편집기 우측이 영영 닿을 수 없게 되는데, 그것을 여기서 잡는다.
/** @effects narrow_window_produces_horizontal_scroll_not_compression */
test('넘친 폭이 잘리지 않고 가로 스크롤로 접근 가능하다 (클리핑 차단)', async ({ page }) => {
await page.setViewportSize({ width: NARROW_WIDTH, height: 900 });
await gotoEditor(page);
@@ -5,8 +5,8 @@
* 비어 모달을 편집할 경로가 없었고, 모달 편집 진입 시 딤(잠긴 호스트) 영역으로 드래그/드롭이
* 가능했으며, `_user_base` 모달 저장이 extension_point 검증으로 422 였다.
*
* @scenario edit_mode + url_sync + dnd_confine
* @effects modal_collection_includes_partial_modals + modal_edit_renders_dim_and_blocker + dnd_handles_confined_to_modal_subtree + modal_edit_exit_clears_dim
* 축 요약(마커 아님 — 평문): edit_mode, url_sync, dnd_confine.
* 효과 요약(마커 아님 — 평문): modal_collection_includes_partial_modals, modal_edit_renders_dim_and_blocker, dnd_handles_confined_to_modal_subtree, modal_edit_exit_clears_dim.
*/
import { test, expect, issueToken, authenticatePage } from '../../fixtures/auth';
@@ -24,6 +24,7 @@ async function enterEditor(page: import('@playwright/test').Page, url: string):
}
test.describe('@layout-editor 모달 편집 confine', () => {
/** @effects modal_collection_includes_partial_modals */
test('편집기 routes 응답이 partial 모달을 수집(트리 노출 SSoT)', async ({ page }) => {
// 백엔드 모달 수집(collectEditorBaseAndModals)이 partial 참조 + 하위 디렉토리까지 읽어
// 모달을 반환하는지 검증 — 트리 [모달]/"이 화면의 모달" 그룹의 데이터 출처. locale 무관.
@@ -52,6 +53,7 @@ test.describe('@layout-editor 모달 편집 confine', () => {
expect(result.hosts).toContain('_user_base');
});
/** @effects modal_edit_renders_dim_and_blocker, dnd_handles_confined_to_modal_subtree */
test('모달 편집 진입 시 딤 음영 + 차단 밴드 + 핸들이 모달 서브트리로 confine', async ({ page }) => {
await enterEditor(page, MODAL_DIRECT_URL);
// 모달 편집 모드 진입 + 딤 음영 마운트 대기.
@@ -79,6 +81,7 @@ test.describe('@layout-editor 모달 편집 confine', () => {
expect(handleClassification.outModal).toBe(0); // 딤 호스트엔 핸들 없음
});
/** @effects modal_edit_exit_clears_dim */
test('모달 편집 종료 → 딤 해제 + 편집 모드 이탈', async ({ page }) => {
await enterEditor(page, MODAL_DIRECT_URL);
await expect(page.locator('[data-mode="modal"]')).toBeAttached({ timeout: 30_000 });
@@ -8,8 +8,8 @@
* 저장 시점에 백엔드가 그 키를 orphaned 로 전이하고, 관리 모달에 "미사용" 배지로 노출된다.
* T4. 정리 — orphaned 키를 일괄 삭제하면 목록에서 사라진다.
*
* @scenario toolbar_translations_button_opens_manager + manager_lists_and_filters + orphan_created_on_save_shows_badge + orphan_bulk_delete
* @effects toolbar_translations_button_opens_manager_modal + manager_filters_by_status_all_active_orphaned + manager_shows_orphaned_badge + save_marks_unreferenced_custom_key_as_orphaned + manager_purges_all_orphaned_keys + manager_lists_custom_keys_for_layout_with_bearer_header
* 축 요약(마커 아님 — 평문): toolbar_translations_button_opens_manager, manager_lists_and_filters, orphan_created_on_save_shows_badge, orphan_bulk_delete.
* 효과 요약(마커 아님 — 평문): toolbar_translations_button_opens_manager_modal, manager_filters_by_status_all_active_orphaned, manager_shows_orphaned_badge, save_marks_unreferenced_custom_key_as_orphaned, manager_purges_all_orphaned_keys, manager_lists_custom_keys_for_layout_with_bearer_header.
*/
import { test, expect, issueToken, authenticatePage } from '../../fixtures/auth';
import type { Page } from '@playwright/test';
@@ -34,6 +34,7 @@ async function openManager(page: Page): Promise<void> {
}
test.describe('@layout-editor 커스텀 다국어 관리 모달 (S8-2 후속)', () => {
/** @effects toolbar_translations_button_opens_manager_modal */
test('T1. 🌐 버튼 → 관리 모달 진입', async ({ page }) => {
await openEditorLogin(page);
await openManager(page);
@@ -43,6 +44,7 @@ test.describe('@layout-editor 커스텀 다국어 관리 모달 (S8-2 후속)',
await expect(page.getByTestId('g7le-translation-manager')).toHaveCount(0);
});
/** @effects manager_filters_by_status_all_active_orphaned */
test('T2. 목록/필터 동작 (비어 있으면 empty, 있으면 필터 탭)', async ({ page }) => {
await openEditorLogin(page);
await openManager(page);
@@ -59,6 +61,7 @@ test.describe('@layout-editor 커스텀 다국어 관리 모달 (S8-2 후속)',
}
});
/** @effects manager_lists_custom_keys_for_layout_with_bearer_header */
test('T3+T4. 모달 fetch 가 Bearer 토큰을 첨부하고 응답을 렌더한다', async ({ page }) => {
await openEditorLogin(page);
// 관리 모달 fetch 요청의 Authorization 헤더를 가로채 검증.
@@ -13,7 +13,7 @@
* ⓘ 메뉴 오픈·드래그 시작 보존을 검증한다.
*
* @scenario context_plus_button selected_node_state=basic_selected
* @effects overlay_affordance_above_drag_handle_zindex + overlay_affordance_click_not_intercepted_by_drag_handle + drag_handle_depth_clamped_below_affordance_band + drag_initiation_preserved_on_element_body_after_affordance_zindex_fix
* 효과 요약(마커 아님 — 평문): overlay_affordance_above_drag_handle_zindex, overlay_affordance_click_not_intercepted_by_drag_handle, drag_handle_depth_clamped_below_affordance_band, drag_initiation_preserved_on_element_body_after_affordance_zindex_fix.
*/
import type { Page } from '@playwright/test';
import { test, expect, issueToken, authenticatePage } from '../../fixtures/auth';
@@ -85,6 +85,7 @@ test.describe('@layout-editor overlay affordance z-index', () => {
});
});
/** @effects overlay_affordance_above_drag_handle_zindex */
test('선택 시 +/ⓘ 버튼이 어포던스 밴드 z-index(120)로 렌더', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -116,6 +117,7 @@ test.describe('@layout-editor overlay affordance z-index', () => {
}
});
/** @effects overlay_affordance_click_not_intercepted_by_drag_handle */
test('+/ⓘ 버튼 정중앙의 topmost 요소가 버튼 자신 — 드래그 핸들에 가로채이지 않음', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -225,6 +227,7 @@ test.describe('@layout-editor overlay affordance z-index', () => {
await expect(page.getByTestId('g7le-context-menu-delete')).toBeVisible();
});
/** @effects drag_handle_depth_clamped_below_affordance_band */
test('드래그 핸들 z-index 가 어포던스 밴드(120) 아래로 클램프 — 어떤 깊이에서도', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -252,6 +255,7 @@ test.describe('@layout-editor overlay affordance z-index', () => {
expect(result.monotonic, '드래그 핸들 z-index 는 base(20) 이상 깊이순 유지').toBe(true);
});
/** @effects drag_initiation_preserved_on_element_body_after_affordance_zindex_fix */
test('드래그 시작은 보존 — 요소 본문 잡고 끌면 고스트 + 드롭 슬롯 생성 (DnD 무회귀)', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -11,11 +11,12 @@
* 잠그며, 본 spec 은 토글 표시/전환의 브라우저 가시 결과를 측정한다.
*
* @scenario layout-editor-page-state-switcher
* @effects login_route_shows_state_toggle_with_two_options + root_route_hides_state_toggle + login_failed_state_renders_form_error_text_on_canvas + profile_edit_password_entry_vs_actual_edit_section_toggle + admin_users_edit_vs_create_title_via_route_id_removal + admin_settings_general_vs_seo_tab_via_query_tab + checkout_validation_failed_renders_dotted_key_inline_errors + guest_order_form_guest_vs_member_branch_toggle_via_currentuser_patch
* 효과 요약(마커 아님 — 평문): login_route_shows_state_toggle_with_two_options, root_route_hides_state_toggle, login_failed_state_renders_form_error_text_on_canvas, profile_edit_password_entry_vs_actual_edit_section_toggle, admin_users_edit_vs_create_title_via_route_id_removal, admin_settings_general_vs_seo_tab_via_query_tab, checkout_validation_failed_renders_dotted_key_inline_errors, guest_order_form_guest_vs_member_branch_toggle_via_currentuser_patch.
*/
import { test, expect, issueToken, authenticatePage } from '../../fixtures/auth';
test.describe('@layout-editor 페이지 상태 토글 (S6-3)', () => {
/** @effects login_route_shows_state_toggle_with_two_options */
test('states 선언 라우트(/login) → 상태 토글 표시 + 항목 2개', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -33,6 +34,7 @@ test.describe('@layout-editor 페이지 상태 토글 (S6-3)', () => {
await expect(options).toHaveCount(2);
});
/** @effects root_route_hides_state_toggle */
test('states 미선언 라우트(/) → 상태 토글 미표시 (디그레이드)', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -49,6 +51,7 @@ test.describe('@layout-editor 페이지 상태 토글 (S6-3)', () => {
await expect(page.getByTestId('g7le-state-switcher')).toHaveCount(0);
});
/** @effects login_failed_state_renders_form_error_text_on_canvas */
test('로그인 실패 상태 전환 → 캔버스에 폼 오류 표시 (formErrors 경로 주입)', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -82,6 +85,7 @@ test.describe('@layout-editor 페이지 상태 토글 (S6-3)', () => {
// initialState.local.isPasswordVerified 패치가 레이아웃 init_actions 의 기본값을 이겨
// 각 단계 화면이 미리보기된다. 신규 다국어 키(editor.state.profile_*)가 캐시 무효화
// 구멍 없이 친화명으로 해석되는지도 함께 측정한다(라벨 raw 회귀 차단).
/** @effects profile_edit_password_entry_vs_actual_edit_section_toggle */
test('profile/edit → 비밀번호 확인 / 실제 수정 단계 토글 + 신규 라벨 해석', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -114,6 +118,7 @@ test.describe('@layout-editor 페이지 상태 토글 (S6-3)', () => {
// route 패치 — admin_user_form 의 route.id 유무(수정↔신규) 변종 (미커버 발굴분).
// admin 라우트는 `*/admin/...` 프리픽스라 URL 직접 인코딩 대신 라우트 트리 클릭으로 진입.
/** @effects admin_users_edit_vs_create_title_via_route_id_removal */
test('admin users/:id/edit → route.id 제거로 수정↔신규 작성 모드 전환', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -139,6 +144,7 @@ test.describe('@layout-editor 페이지 상태 토글 (S6-3)', () => {
});
// query 패치 — admin_settings 의 query.tab 변종 (미커버 발굴분).
/** @effects admin_settings_general_vs_seo_tab_via_query_tab */
test('admin settings → query.tab 으로 일반↔SEO 탭 전환', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -162,6 +168,7 @@ test.describe('@layout-editor 페이지 상태 토글 (S6-3)', () => {
// `_local.errors?.['orderer.name']` 처럼 **키 자체에 점이 박힌** flat 키로 읽는다. 페이지
// 상태 formErrors 키를 대괄호 표기(`_local.errors['orderer.name']`)로 지정하면
// tokenizePath 가 점을 리터럴 leaf 로 보존해 인라인 에러가 캔버스에 표현된다.
/** @effects checkout_validation_failed_renders_dotted_key_inline_errors */
test('checkout → validation_failed 전환 시 점 박힌 키 인라인 에러 노출', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -211,6 +218,7 @@ test.describe('@layout-editor 페이지 상태 토글 (S6-3)', () => {
// 안내). 편집기 sampleGlobal 은 로그인 고정이라 상태 그룹이 없으면 비회원 조회 폼이 영영
// 미표시되어 편집 불가였다. guest 상태(currentUser:null 패치)로 폼을, member 상태(패치
// 없음)로 안내 분기를 각각 캔버스에 노출하는지 측정한다(라이브 실측 회귀 차단).
/** @effects guest_order_form_guest_vs_member_branch_toggle_via_currentuser_patch */
test('guest_order_form → 비회원(조회 폼) ↔ 회원(마이페이지 안내) 분기 전환', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -24,8 +24,8 @@
* - guest_only 레이아웃은 체인 레벨에서 코어 keyspace currentUser 를 시드에서 제외(흡수).
* "이미 로그인되어 있습니다" 토스트 미발화 가드.
*
* @scenario palette_i18n + global_seed + sample_global_chain + guest_only_no_currentUser + save_success
* @effects undo_history_reset + banner_visible + guest_only_no_redirect_toast, editor_save_specs_target_sandbox_layout_not_product_layout
* 축 요약(마커 아님 — 평문): palette_i18n, global_seed, sample_global_chain, guest_only_no_currentUser, save_success.
* 효과 요약(마커 아님 — 평문): undo_history_reset, banner_visible, guest_only_no_redirect_toast, editor_save_specs_target_sandbox_layout_not_product_layout.
*/
import { test, expect, issueToken, authenticatePage } from '../../fixtures/auth';
import { sandboxRouteParam } from '../../fixtures/seed-layout';
@@ -105,6 +105,7 @@ test.describe('@layout-editor palette i18n + global seed', () => {
await expect(myPageBtn).toBeVisible();
});
/** @effects guest_only_no_redirect_toast */
test('guest_only 레이아웃 — sampleGlobal 체인이 currentUser 시드 제외 + 토스트 미발화', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -139,6 +140,7 @@ test.describe('@layout-editor palette i18n + global seed', () => {
// 저장(PUT)하는 테스트는 편집 결과가 그대로 영속되므로 제품 화면(home)이 아니라 E2E 전용
// 시드 화면(e2e_sandbox)을 대상으로 한다. 시드 화면은 globalSetup 이 매 실행 fixture 원본으로
// 덮어쓰므로 회차 간 Div 누적이 성립하지 않는다.
/** @effects undo_history_reset, banner_visible, editor_save_specs_target_sandbox_layout_not_product_layout */
test('저장 success kind → SaveFeedbackBanner 표시 + history reset (결함 E + I 회귀 가드)', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -28,8 +28,8 @@
* 단위(prop-i18n-text-field.test 칸자리 칩 4건)로 검증한다. 본 spec 은 종전대로 평문 미리보기 input·키
* 생성·펼침 폼 노출·저장 영속(비-칩 경로)을 라이브로 잠근다.
*
* @scenario prop_i18n_text_field_inline_preview + prop_i18n_create_key_via_post + prop_i18n_expand_ko_en_ja + children_item_text_i18n_widget + token_persists_on_save
* @effects text_propcontrol_renders_i18n_widget_not_raw_key_input, prop_i18n_plain_input_creates_custom_key_via_post, prop_i18n_expand_shows_all_active_locales_bulk_form, children_item_text_uses_shared_i18n_widget_ssot, custom_key_token_recorded_in_prop_value_and_node_text_persists_on_put, editor_save_specs_target_sandbox_layout_not_product_layout
* 축 요약(마커 아님 — 평문): prop_i18n_text_field_inline_preview, prop_i18n_create_key_via_post, prop_i18n_expand_ko_en_ja, children_item_text_i18n_widget, token_persists_on_save.
* 효과 요약(마커 아님 — 평문): text_propcontrol_renders_i18n_widget_not_raw_key_input, prop_i18n_plain_input_creates_custom_key_via_post, prop_i18n_expand_shows_all_active_locales_bulk_form, children_item_text_uses_shared_i18n_widget_ssot, custom_key_token_recorded_in_prop_value_and_node_text_persists_on_put, editor_save_specs_target_sandbox_layout_not_product_layout.
*/
import { test, expect, issueToken, authenticatePage } from '../../fixtures/auth';
import type { Page } from '@playwright/test';
@@ -116,6 +116,7 @@ async function openPropsTab(page: Page): Promise<void> {
}
test.describe('@layout-editor 텍스트 propControl 동적 다국어 (부록7 7-b)', () => {
/** @effects text_propcontrol_renders_i18n_widget_not_raw_key_input, prop_i18n_plain_input_creates_custom_key_via_post, prop_i18n_expand_shows_all_active_locales_bulk_form */
test('Input placeholder propControl 이 raw 키 아닌 i18n 위젯(미리보기+🌐)으로 렌더되고 평문 입력→키 생성→펼침', async ({ page }) => {
await gotoEditor(page);
const vdiv = await addEmptyDiv(page);
@@ -159,6 +160,7 @@ test.describe('@layout-editor 텍스트 propControl 동적 다국어 (부록7 7-
// 저장(PUT)하는 테스트는 편집 결과가 그대로 영속되므로 제품 화면(home)이 아니라 E2E 전용
// 시드 화면(e2e_sandbox)을 대상으로 한다. 시드 화면은 globalSetup 이 매 실행 fixture 원본으로
// 덮어쓰므로 회차 간 누적이 성립하지 않는다.
/** @effects children_item_text_uses_shared_i18n_widget_ssot, custom_key_token_recorded_in_prop_value_and_node_text_persists_on_put, editor_save_specs_target_sandbox_layout_not_product_layout */
test('children 항목 텍스트도 동일 i18n 위젯으로 편집(평문→키 생성) + 저장 PUT 200 영속', async ({ page }) => {
await gotoEditor(page, sandboxRouteParam());
const vdiv = await addEmptyDiv(page, true);
@@ -220,8 +222,8 @@ test.describe('@layout-editor 텍스트 propControl 동적 다국어 (부록7 7-
// 가로 스크롤 회귀 — 속성 모달 본문은 긴 텍스트 입력·🌐 펼침 폼에서도 가로로
// 넘치지 않아야 한다. 컨트롤
// 행/위젯 컨테이너 + 펼침 폼의 minWidth:0 가드를 라이브 브라우저로 잠근다.
// @scenario property_modal_no_horizontal_scroll_on_long_input + property_modal_no_horizontal_scroll_on_expand
// @effects control_row_and_widget_minwidth0_prevent_body_horizontal_scroll, expand_locale_form_minwidth0_prevents_body_horizontal_scroll
// 축 요약(마커 아님 — 평문): property_modal_no_horizontal_scroll_on_long_input, property_modal_no_horizontal_scroll_on_expand.
/** @effects control_row_and_widget_minwidth0_prevent_body_horizontal_scroll, expand_locale_form_minwidth0_prevents_body_horizontal_scroll */
test('속성 모달 본문은 긴 입력·🌐 펼침에서도 가로 스크롤이 없다', async ({ page }) => {
await gotoEditor(page);
const vdiv = await addEmptyDiv(page);
@@ -12,8 +12,8 @@
* 실제 편집기 DOM 에서 선택→모달→패치 라운드트립과 딤/잠금 해제를 브라우저로 검증한다
* (단위 시뮬레이션이 모사 못 하는 modal.stack 파생 + 실제 React 재렌더 경로).
*
* @scenario iteration_shared_edit + affordance_gap + edit_lock_dim + edit_lock_release + permission_candidate_add
* @effects all_iteration_instances_patched + affordance_offset_30 + canvas_dim_on_modal + canvas_undim_on_close + permission_add_enabled
* 축 요약(마커 아님 — 평문): iteration_shared_edit, affordance_gap, edit_lock_dim, edit_lock_release, permission_candidate_add.
* 효과 요약(마커 아님 — 평문): all_iteration_instances_patched, affordance_offset_30, canvas_dim_on_modal, canvas_undim_on_close, permission_add_enabled.
*/
import { test, expect, issueToken, authenticatePage } from '../../fixtures/auth';
import type { Page } from '@playwright/test';
@@ -54,6 +54,7 @@ async function openModalStyleTab(page: Page): Promise<void> {
}
test.describe('@layout-editor 속성 편집 UX', () => {
/** @effects all_iteration_instances_patched */
test('항목1 — 이터레이션 인스턴스 속성 편집이 모든 인스턴스에 함께 반영', async ({ page }) => {
await gotoEditor(page);
@@ -101,6 +102,7 @@ test.describe('@layout-editor 속성 편집 UX', () => {
.toBe(count);
});
/** @effects affordance_offset_30 */
test('항목2/3 — 큰(inside) 편집 가능 요소의 + 버튼·ⓘ 버튼 30px 바깥 여백', async ({ page }) => {
await gotoEditor(page, '%2Flogin');
@@ -141,6 +143,7 @@ test.describe('@layout-editor 속성 편집 UX', () => {
expect(measured.aboveTop).toBe('-30px');
});
/** @effects canvas_dim_on_modal, canvas_undim_on_close */
test('항목7 — 속성 편집 중 캔버스 딤/잠금 + 닫기(편집 후 포함) 시 자동 해제', async ({ page }) => {
await gotoEditor(page);
@@ -205,6 +208,7 @@ test.describe('@layout-editor 속성 편집 UX', () => {
await expect(page.locator('[data-testid="g7le-property-modal"]')).toHaveCount(0);
});
/** @effects permission_add_enabled */
test('표시 권한 — 고급 탭 TagInput 후보가 편집기 전용 엔드포인트에서 fetch 되어 추가 활성', async ({ page }) => {
await gotoEditor(page);
@@ -10,8 +10,8 @@
* - guest_only 레이아웃: 템플릿이 currentUser 를 시드해도 비로그인 페이지에서 제외 →
* "이미 로그인되어 있습니다" 토스트 미발화
*
* @scenario property_modal_open + style_control_patch + sample_global_from_template + guest_only_no_currentUser
* @effects modal_visible + canvas_live_patch + site_name_seeded + guest_only_no_redirect_toast
* 축 요약(마커 아님 — 평문): property_modal_open, style_control_patch, sample_global_from_template, guest_only_no_currentUser.
* 효과 요약(마커 아님 — 평문): modal_visible, canvas_live_patch, site_name_seeded, guest_only_no_redirect_toast.
*/
import { test, expect, issueToken, authenticatePage } from '../../fixtures/auth';
@@ -56,6 +56,7 @@ async function selectNodeWithInfoButton(page: import('@playwright/test').Page):
}
test.describe('@layout-editor 속성 편집 모달 (S6-2)', () => {
/** @effects modal_visible, canvas_live_patch */
test('요소 선택 → ⓘ → 속성 설정 → 스타일 탭 컨트롤 렌더 + 패치', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -93,6 +94,7 @@ test.describe('@layout-editor 속성 편집 모달 (S6-2)', () => {
expect(hasStyleTab + hasNoEditable).toBeGreaterThan(0);
});
/** @effects site_name_seeded */
test('sampleGlobal: 번들 템플릿 시드로 _global.currentUser / settings 가 채워진다 (코어 시드 폐기 후)', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -116,6 +118,7 @@ test.describe('@layout-editor 속성 편집 모달 (S6-2)', () => {
);
});
/** @effects guest_only_no_redirect_toast */
test('guest_only 레이아웃: 템플릿 currentUser 시드 제외 → "이미 로그인" 토스트 미발화', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -9,8 +9,8 @@
* D. 텍스트 정렬 justify 옵션 노출 + 적용 → text-justify.
* E. 고급 탭 — 권한 후보가 식별자(key)와 함께 표시되고, 카테고리(부모)는 제외(리프만).
*
* @scenario new_style_controls_live_apply + border_color_preset + text_format_toggle + justify_align + permission_identifier_leaf_only
* @effects box_class_tokens + border_color_token + italic_underline_tokens + text_justify_token + advanced_permission_id_visible
* 축 요약(마커 아님 — 평문): new_style_controls_live_apply, border_color_preset, text_format_toggle, justify_align, permission_identifier_leaf_only.
* 효과 요약(마커 아님 — 평문): box_class_tokens, border_color_token, italic_underline_tokens, text_justify_token, advanced_permission_id_visible.
*/
import { test, expect, issueToken, authenticatePage } from '../../fixtures/auth';
import { editorPath } from '../../fixtures/layout-editor';
@@ -81,6 +81,7 @@ const tokensOf = (page: import('@playwright/test').Page, path: string) =>
page.evaluate((p) => (document.querySelector(`[data-editor-path="${p}"]`)?.className ?? '').split(/\s+/).filter(Boolean), path);
test.describe('@layout-editor 신규 스타일 컨트롤', () => {
/** @effects box_class_tokens */
test('A. 컨테이너 박스 컨트롤 — 그림자/라운드/스크롤 select 가 캔버스에 반영', async ({ page }) => {
await openEditorLogin(page);
await openPropsFor(page, CARD);
@@ -121,6 +122,7 @@ test.describe('@layout-editor 신규 스타일 컨트롤', () => {
await expect.poll(() => tokensOf(page, CARD)).toContain('opacity-50');
});
/** @effects border_color_token */
test('B. 테두리 색 프리셋 → border-{color} 토큰', async ({ page }) => {
await openEditorLogin(page);
await openPropsFor(page, CARD);
@@ -130,6 +132,7 @@ test.describe('@layout-editor 신규 스타일 컨트롤', () => {
await expect.poll(() => tokensOf(page, CARD)).toContain('border-blue-600');
});
/** @effects italic_underline_tokens */
test('C. 텍스트 서식 — 기울임/밑줄 토글이 제목에 반영', async ({ page }) => {
await openEditorLogin(page);
await openPropsFor(page, CARD_H2);
@@ -141,6 +144,7 @@ test.describe('@layout-editor 신규 스타일 컨트롤', () => {
await expect.poll(() => tokensOf(page, CARD_H2)).toContain('underline');
});
/** @effects text_justify_token */
test('D. 텍스트 정렬 justify 옵션 적용 → text-justify', async ({ page }) => {
await openEditorLogin(page);
await openPropsFor(page, CARD_H2);
@@ -148,6 +152,7 @@ test.describe('@layout-editor 신규 스타일 컨트롤', () => {
await expect.poll(() => tokensOf(page, CARD_H2)).toContain('text-justify');
});
/** @effects advanced_permission_id_visible */
test('E. 고급 탭 — 권한 후보에 식별자 표시 + 카테고리(부모) 제외', async ({ page }) => {
await openEditorLogin(page);
await openPropsFor(page, CARD);
@@ -7,8 +7,8 @@
* C. (A 로 해소) 수평 컨테이너(정렬 박스)에서 좌/우 삽입 어포던스 활성 — block 은 상/하만.
* D. 표(Table) 추가 → 머리글/본문 행이 실제로 렌더(빈 table 회귀 차단).
*
* @scenario flex_toggle_node_derived + spacing_per_side_independent + insertion_dir_by_flow + table_renders_rows
* @effects flex_container_controls_and_disable + pt_pl_coexist + left_right_enabled_in_flex + table_tr_td_rendered
* 축 요약(마커 아님 — 평문): flex_toggle_node_derived, spacing_per_side_independent, insertion_dir_by_flow, table_renders_rows.
* 효과 요약(마커 아님 — 평문): flex_container_controls_and_disable, pt_pl_coexist, left_right_enabled_in_flex, table_tr_td_rendered.
*/
import { test, expect, issueToken, authenticatePage } from '../../fixtures/auth';
import { editorPath as resolveEditorPath } from '../../fixtures/layout-editor';
@@ -52,6 +52,7 @@ async function openPropsFor(page: import('@playwright/test').Page, editorPath: s
}
test.describe('@layout-editor S7 후속 회귀', () => {
/** @effects flex_container_controls_and_disable */
test('A. 정렬 박스 만들기 → 컨테이너 컨트롤 + 해제 토글로 원복 (노드 파생 판정)', async ({ page }) => {
await openEditorLogin(page);
await openPropsFor(page, CARD);
@@ -82,6 +83,7 @@ test.describe('@layout-editor S7 후속 회귀', () => {
await expect(page.getByTestId('g7le-flex-enable')).toBeAttached();
});
/** @effects pt_pl_coexist */
test('B. 여백 개별 모드 — 상/좌를 다른 값으로 → pt-/pl- 토큰 공존', async ({ page }) => {
await openEditorLogin(page);
await openPropsFor(page, CARD);
@@ -106,6 +108,7 @@ test.describe('@layout-editor S7 후속 회귀', () => {
).toBe(true);
});
/** @effects left_right_enabled_in_flex */
test('C. 흐름별 삽입 방향 — flex-row 자식은 좌/우 활성, block 자식은 상/하만', async ({ page }) => {
await openEditorLogin(page);
@@ -132,6 +135,7 @@ test.describe('@layout-editor S7 후속 회귀', () => {
expect(await page.getByTestId('g7le-insertion-below').getAttribute('data-disabled')).toBe('false');
});
/** @effects table_tr_td_rendered */
test('D. 표 추가 → 머리글/본문 행이 실제 렌더(빈 table 회귀 차단)', async ({ page }) => {
await openEditorLogin(page);
@@ -5,17 +5,11 @@
* 스타일/flex/표시조건을 해당 위치(responsive.{bp}.props / dark: 토큰 / responsive.{bp}.if)에
* 무손실로 기록·역해석하고, 저장·새로고침 후 복원되는지 검증한다.
*
* @scenario color_scheme × device × apply_type × edit_target
* @effects device_scope_writes_responsive_breakpoint_props_base_unchanged
* + dark_classToken_coexists_with_light_token_in_one_className
* + dark_inline_control_readonly_value_never_overwritten
* + scope_without_override_shows_base_inherited_value_as_placeholder
* + custom_range_scope_writes_responsive_range_key
* + device_flex_disable_writes_explicit_off_token_breaking_base_inheritance
* + modal_scope_snapshots_toolbar_on_open
* + modal_scope_independent_after_toolbar_change
* + save_persists_responsive_and_if_on_reload
* + preview_color_scheme_toggle_applies_dark_wrapper_to_preview_frame_only
* 축 요약(마커 아님 — 평문): color_scheme, device, apply_type, edit_target. 요약을 시나리오 축 마커
* 로 적으면 마커 파서가 `=` 없는 토큰을 버려 빈 조합 `{}` 이
* 된다 — 실재하지 않는 조합이 커버 집합에 들어가는 방향이라 요약은 평문으로 둔다.
*
* 효과 요약(마커 아님 — 평문): device_scope_writes_responsive_breakpoint_props_base_unchanged, dark_classToken_coexists_with_light_token_in_one_className, dark_inline_control_readonly_value_never_overwritten, scope_without_override_shows_base_inherited_value_as_placeholder, custom_range_scope_writes_responsive_range_key, device_flex_disable_writes_explicit_off_token_breaking_base_inheritance, modal_scope_snapshots_toolbar_on_open, modal_scope_independent_after_toolbar_change, save_persists_responsive_and_if_on_reload, preview_color_scheme_toggle_applies_dark_wrapper_to_preview_frame_only.
*/
import { test, expect, issueToken, authenticatePage } from '../../fixtures/auth';
import type { Page } from '@playwright/test';
@@ -79,6 +73,7 @@ test.describe('@layout-editor 스타일 탭 색 모드 × 디바이스 scope', (
await expect(page.getByTestId('g7le-style-bp-add-custom')).toBeVisible();
});
/** @effects device_scope_writes_responsive_breakpoint_props_base_unchanged */
test('T2: 디바이스 탭에서 textAlign 변경 → 기본값 className 시드되어 base 토큰 보존(B안)', async ({ page }) => {
await openEditorLogin(page);
await openPropsFor(page, CARD);
@@ -105,6 +100,7 @@ test.describe('@layout-editor 스타일 탭 색 모드 × 디바이스 scope', (
}
});
/** @effects scope_without_override_shows_base_inherited_value_as_placeholder */
test('T2b: 디바이스 override 후 "기본값으로 초기화" → 표시점/override 제거', async ({ page }) => {
await openEditorLogin(page);
await openPropsFor(page, CARD);
@@ -122,6 +118,7 @@ test.describe('@layout-editor 스타일 탭 색 모드 × 디바이스 scope', (
}
});
/** @effects dark_inline_control_readonly_value_never_overwritten */
test('T3: 다크 세부탭에서 인라인 색상 컨트롤은 읽기전용 안내', async ({ page }) => {
await openEditorLogin(page);
await openPropsFor(page, CARD);
@@ -137,6 +134,7 @@ test.describe('@layout-editor 스타일 탭 색 모드 × 디바이스 scope', (
}
});
/** @effects dark_classToken_coexists_with_light_token_in_one_className */
test('T3b: 색 컨트롤 classToken — 라이트 프리셋 적용 + 다크 프리셋 dark: 토큰 공존', async ({ page }) => {
await openEditorLogin(page);
await openPropsFor(page, CARD);
@@ -166,6 +164,7 @@ test.describe('@layout-editor 스타일 탭 색 모드 × 디바이스 scope', (
}
});
/** @effects custom_range_scope_writes_responsive_range_key */
test('T6: 커스텀 크기 탭 추가 → 600-900 탭 활성 + 우선순위 안내', async ({ page }) => {
await openEditorLogin(page);
await openPropsFor(page, CARD);
@@ -192,6 +191,7 @@ test.describe('@layout-editor 스타일 탭 색 모드 × 디바이스 scope', (
}
});
/** @effects preview_color_scheme_toggle_applies_dark_wrapper_to_preview_frame_only */
test('T12: 툴바 라이트/다크 토글 → 프리뷰 프레임만.g7le-preview-dark (편집기 chrome 비다크 격리)', async ({ page }) => {
await openEditorLogin(page);
@@ -17,7 +17,7 @@
* 검수)로 검증한다(feedback_chrome_mcp_dnd_kit_incompatible).
*
* @scenario responsive_branch_edit drag_drop
* @effects branch_drop_slots_render + branch_node_has_drag_handle
* 효과 요약(마커 아님 — 평문): branch_drop_slots_render, branch_node_has_drag_handle.
*/
import type { Page } from '@playwright/test';
import { test, expect, issueToken, authenticatePage } from '../../fixtures/auth';
@@ -124,6 +124,7 @@ test.describe('@layout-editor responsive 분기 드래그/슬롯', () => {
});
});
/** @effects branch_node_has_drag_handle */
test('모바일 보기에서 responsive 분기 자식이 드래그 핸들을 가진다', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -141,6 +142,7 @@ test.describe('@layout-editor responsive 분기 드래그/슬롯', () => {
).toBeGreaterThan(0);
});
/** @effects branch_drop_slots_render */
test('분기 안 노드를 드래그하면 같은 분기 안에 드롭 슬롯이 생성된다 (결함① 회귀 가드)', async ({
page,
}) => {
@@ -11,7 +11,7 @@
* `search_row`(portable **children** 교체)를 함께 가져, 두 판정 분기를 한 화면에서 검증한다.
*
* @scenario responsive_branch_edit device_list style_scope_tab branch_separation
* @effects device_toggle_has_portable + style_tab_has_portable + separation_mode_by_children
* 효과 요약(마커 아님 — 평문): device_toggle_has_portable, style_tab_has_portable, separation_mode_by_children.
*/
import type { Page } from '@playwright/test';
import { test, expect, issueToken, authenticatePage } from '../../fixtures/auth';
@@ -82,6 +82,7 @@ async function selectNodeById(page: Page, id: string): Promise<void> {
}
test.describe('@layout-editor responsive 디바이스 목록 + 분리 판정', () => {
/** @effects device_toggle_has_portable */
test('디바이스 토글에 portable(모바일+태블릿) 버튼이 노출된다 ', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -94,6 +95,7 @@ test.describe('@layout-editor responsive 디바이스 목록 + 분리 판정', (
}
});
/** @effects style_tab_has_portable */
test('스타일 탭 디바이스 세부탭에 portable 세부탭이 노출된다 ', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -126,6 +128,7 @@ test.describe('@layout-editor responsive 디바이스 목록 + 분리 판정', (
await expect(page.locator('[data-testid="g7le-style-bp-portable"]')).toBeAttached();
});
/** @effects separation_mode_by_children */
test('분리 판정은 children 유무 기준 — props-only=생성 / children=해제 ', async ({
page,
}) => {
@@ -9,8 +9,8 @@
* 확장 편집 모드에서 목록이 줄어들던 결함, (2) 확장/모달 편집 모드에서 라우트를 클릭하면
* "이 레이아웃에는 표시할 컴포넌트가 없습니다" 가 뜨던 결함을 가드한다.
*
* @scenario ext_type + host_match + conn_count + conn_group_state + enter_mode_from_child + select_route_from_mode + host_highlight
* @effects connected_extensions_attached_statically_by_host_layouts_without_canvas_load + connected_group_collapsed_by_default + connected_group_toggles_on_header_click + connected_count_stable_when_entering_extension_edit_mode + extension_child_click_enters_extension_edit_keeping_host_route_highlight + select_route_from_separate_edit_mode_restores_route_mode_and_renders_canvas
* 축 요약(마커 아님 — 평문): ext_type, host_match, conn_count, conn_group_state, enter_mode_from_child, select_route_from_mode, host_highlight.
* 효과 요약(마커 아님 — 평문): connected_extensions_attached_statically_by_host_layouts_without_canvas_load, connected_group_collapsed_by_default, connected_group_toggles_on_header_click, connected_count_stable_when_entering_extension_edit_mode, extension_child_click_enters_extension_edit_keeping_host_route_highlight, select_route_from_separate_edit_mode_restores_route_mode_and_renders_canvas.
*/
import { test, expect, issueToken, authenticatePage } from '../../fixtures/auth';
import type { Page } from '@playwright/test';
@@ -46,6 +46,7 @@ async function readConnCount(page: Page): Promise<number> {
}
test.describe('@layout-editor route↔connected extensions', () => {
/** @effects connected_extensions_attached_statically_by_host_layouts_without_canvas_load, connected_group_collapsed_by_default */
test('클릭 없이 host_layouts 정적 매칭으로 연결 확장이 표시 + 기본 접힘', async ({ page }) => {
await enterEditor(page);
@@ -60,6 +61,7 @@ test.describe('@layout-editor route↔connected extensions', () => {
await expect(header).toHaveAttribute('aria-expanded', 'false');
});
/** @effects connected_group_toggles_on_header_click */
test('연결 그룹 헤더 클릭 → 펼침 → 자식 표시', async ({ page }) => {
await enterEditor(page);
const header = connGroupHeader(page);
@@ -79,6 +81,7 @@ test.describe('@layout-editor route↔connected extensions', () => {
expect(expandedCount).toBeGreaterThan(0);
});
/** @effects connected_count_stable_when_entering_extension_edit_mode, extension_child_click_enters_extension_edit_keeping_host_route_highlight */
test('확장 편집 모드 진입 후에도 연결 목록 count 유지 + 호스트 라우트 강조', async ({ page }) => {
await enterEditor(page);
const header = connGroupHeader(page);
@@ -110,6 +113,7 @@ test.describe('@layout-editor route↔connected extensions', () => {
expect(hostHighlighted).toBe(true);
});
/** @effects select_route_from_separate_edit_mode_restores_route_mode_and_renders_canvas */
test('확장 편집 모드에서 라우트 클릭 → 캔버스 정상 렌더(빈 화면 회귀 가드)', async ({ page }) => {
await enterEditor(page);
const header = connGroupHeader(page);
@@ -10,8 +10,8 @@
* - 항목7: 선택 노드(Button 포함)에 리사이즈 핸들 표시 + 드래그로 px 변화
* - 항목8: 툴바 ↺ 초기화 버튼(dirty 시 활성)
*
* @scenario property_modal_draggable + dimension_widget + image_manager_toolbar + session_cache_restore + dirty_badge + beforeunload_guard + resize_handle + reset_button
* @effects modal_draggable + dimension_free_input + image_modal_open + edit_preserved_on_route_switch + tree_dirty_dot + unload_warning + resize_px_change + reset_reverts
* 축 요약(마커 아님 — 평문): property_modal_draggable, dimension_widget, image_manager_toolbar, session_cache_restore, dirty_badge, beforeunload_guard, resize_handle, reset_button.
* 효과 요약(마커 아님 — 평문): modal_draggable, dimension_free_input, image_modal_open, edit_preserved_on_route_switch, tree_dirty_dot, unload_warning, resize_px_change, reset_reverts.
*/
import { test, expect, issueToken, authenticatePage } from '../../fixtures/auth';
@@ -83,6 +83,7 @@ async function openPropertyModal(page: import('@playwright/test').Page): Promise
}
test.describe('@layout-editor S6-2 후속', () => {
/** @effects modal_draggable */
test('항목1 — 속성 편집 모달이 draggable + 백드롭 pointerEvents:none', async ({ page }) => {
await gotoEditor(page);
await openPropertyModal(page);
@@ -99,6 +100,7 @@ test.describe('@layout-editor S6-2 후속', () => {
expect(pe).toBe('none');
});
/** @effects dimension_free_input */
test('항목2 — 스타일 탭 width 컨트롤이 dimension 위젯(자유 입력)으로 렌더', async ({ page }) => {
await gotoEditor(page);
await openPropertyModal(page);
@@ -124,6 +126,7 @@ test.describe('@layout-editor S6-2 후속', () => {
}
});
/** @effects image_modal_open */
test('항목3 — 툴바 🖼 이미지 버튼 → 이미지 관리 모달', async ({ page }) => {
await gotoEditor(page);
const imagesBtn = page.getByTestId('g7le-toolbar-images');
@@ -134,6 +137,7 @@ test.describe('@layout-editor S6-2 후속', () => {
// 툴바 진입은 onSelect 미전달 → "배경으로 사용" 버튼 없음(빈 목록이면 empty 안내)
});
/** @effects reset_reverts, tree_dirty_dot */
test('항목8 — ↺ 초기화 버튼은 dirty 일 때만 활성', async ({ page }) => {
await gotoEditor(page);
const resetBtn = page.getByTestId('g7le-toolbar-reset');
@@ -142,6 +146,7 @@ test.describe('@layout-editor S6-2 후속', () => {
await expect(resetBtn).toBeDisabled();
});
/** @effects resize_px_change */
test('항목7 — 선택 노드에 리사이즈 핸들 표시', async ({ page }) => {
await gotoEditor(page);
// 선택 오버레이 등장 후, width/height 컨트롤 보유 노드면 리사이즈 핸들이 보인다.
@@ -10,13 +10,14 @@
* 채워져 가격(`원`) 텍스트가 나타나는지(= sampleData 가 실제 캔버스 바인딩을 채움) 검증한다.
* Vitest 는 JSON+격리 렌더, 본 spec 은 실제 편집기 chrome + 캔버스 통합 렌더.
*
* @scenario route_select:data_dependent + sample_provider_source:bundled_editor_spec
* @effects canvas_data_dependent_screen_filled_with_sample_data
* @effects preview_canvas_uses_merged_editor_spec_sampledata
* 축 요약(마커 아님 — 평문): route_select:data_dependent, sample_provider_source:bundled_editor_spec.
* 효과 요약(마커 아님 — 평문): canvas_data_dependent_screen_filled_with_sample_data.
* 효과 요약(마커 아님 — 평문): preview_canvas_uses_merged_editor_spec_sampledata.
*/
import { test, expect, issueToken, authenticatePage } from '../../fixtures/auth';
test.describe('@layout-editor 캔버스 샘플 데이터 렌더', () => {
/** @effects canvas_data_dependent_screen_filled_with_sample_data, preview_canvas_uses_merged_editor_spec_sampledata */
test('sirsoft-basic — 상품 상세 라우트 선택 시 캔버스가 product 샘플로 채워진다', async ({ page }) => {
const tokenAuth = issueToken('core.templates.layouts.edit');
await authenticatePage(page, tokenAuth);
@@ -17,9 +17,9 @@
* Vitest 는 JSON+격리 렌더로 시뮬레이터 경로를 잠그고, 본 spec 은 실제 편집기 chrome +
* 캔버스 통합 렌더에서 게이트 본체가 실제로 보이는지(브라우저 가시 결과)를 측정한다.
*
* @scenario gate_body_kind:computed_if_gate + gate_body_kind:lazy_datasource_subtab
* @effects shipping_policy_edit_country_setting_panel_renders_via_computed_gate
* @effects mypage_board_my_comments_subtab_renders_via_lazy_datasource_sample_injection
* 축 요약(마커 아님 — 평문): gate_body_kind:computed_if_gate, gate_body_kind:lazy_datasource_subtab.
* 효과 요약(마커 아님 — 평문): shipping_policy_edit_country_setting_panel_renders_via_computed_gate.
* 효과 요약(마커 아님 — 평문): mypage_board_my_comments_subtab_renders_via_lazy_datasource_sample_injection.
*/
import { test, expect, issueToken, authenticatePage } from '../../fixtures/auth';
@@ -27,6 +27,7 @@ test.describe('@layout-editor 게이트 본체 캔버스 노출', () => {
// (1) _computed 게이트 — 배송정책 수정 폼의 국가별 설정 본체는 `if: {{_computed.activeCountrySetting}}`
// 게이트 뒤에 있다. PreviewCanvas 가 computed 블록을 미주입하면 _computed.* 가 항상 undefined →
// 국가별 설정 패널이 통째로 비어 렌더된다. 부과정책 상태로 게이트를 열어 본체 렌더를 측정.
/** @effects shipping_policy_edit_country_setting_panel_renders_via_computed_gate */
test('배송정책 수정 → _computed 게이트 국가별 설정 본체가 캔버스에 렌더된다', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -62,6 +63,7 @@ test.describe('@layout-editor 게이트 본체 캔버스 노출', () => {
// (2) 지연 데이터소스 게이트 — 마이페이지 게시판 활동의 "내 댓글" 서브탭 본체는 지연 소스
// myComments(auto_fetch:false) 에 바인딩된다. 샘플 모드 지연 소스 주입이 없으면 서브탭 게이트를
// 페이지 상태로 열어도 데이터가 비어 본체가 미렌더된다. my_comments 상태 전환 후 본체 렌더 측정.
/** @effects mypage_board_my_comments_subtab_renders_via_lazy_datasource_sample_injection */
test('마이페이지 게시판 → my_comments 서브탭 지연 소스 본체가 캔버스에 렌더된다', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -15,7 +15,7 @@
* EditorCanvasOverlay)로 커버한다.
*
* @scenario lock_kind selected_node_state=extension_originated
* @effects extension_node_context_menu_blocked + extension_node_blackbox_selection_normalized + editor_canvas_single_window_scroll + fullscreen_layout_expanded_in_editor
* 효과 요약(마커 아님 — 평문): extension_node_context_menu_blocked, extension_node_blackbox_selection_normalized, editor_canvas_single_window_scroll, fullscreen_layout_expanded_in_editor.
*/
import type { Page } from '@playwright/test';
import { test, expect, issueToken, authenticatePage } from '../../fixtures/auth';
@@ -49,6 +49,7 @@ async function openAdminUserForm(page: Page): Promise<void> {
}
test.describe('@layout-editor 스크롤 + 확장 잠금 후속', () => {
/** @effects extension_node_context_menu_blocked, extension_node_blackbox_selection_normalized */
test('확장 주입 조각 내부 자식 클릭 → 진입점 통짜 선택 + ⓘ 메뉴 차단 + 확장 편집 어포던스', async ({ page }) => {
await openAdminUserForm(page);
@@ -92,6 +93,7 @@ test.describe('@layout-editor 스크롤 + 확장 잠금 후속', () => {
expect(result.editExtension).toBe(true);
});
/** @effects editor_canvas_single_window_scroll */
test('일반(min-h-screen) 페이지 — 캔버스 별도 스크롤 없음 + 브라우저 단일 스크롤 + 헤더/트리 고정', async ({ page }) => {
await openBasicEditor(page);
@@ -125,6 +127,7 @@ test.describe('@layout-editor 스크롤 + 확장 잠금 후속', () => {
expect(metrics.treeStaysFixed).toBe(true);
});
/** @effects fullscreen_layout_expanded_in_editor */
test('admin 풀스크린(h-screen) 레이아웃 — 편집 캔버스에서 콘텐츠 자연 높이로 펼침(내부 스크롤 없음)', async ({ page }) => {
await openAdminUserForm(page);
@@ -4,8 +4,8 @@
* Phase 1 에서 액션 골격만 도입됐던 4개 별도 편집 모드의 캔버스 단독 렌더 + 진입/이탈 +
* URL 동기화를 브라우저에서 검증한다(단위 테스트가 못 잡는 render-cycle + URL pushState).
*
* @scenario edit_mode + url_sync + followup_action
* @effects route_tree_renders_base_modal_extension_groups + base_edit_loads_and_renders_base_layout_standalone + modal_edit_renders_modal_open_standalone_no_dim + extension_edit_loads_via_layout_extensions_api + enter_edit_mode_pushes_edit_query_to_url + refresh_with_edit_query_restores_edit_mode + back_button_exits_edit_mode_to_route
* 축 요약(마커 아님 — 평문): edit_mode, url_sync, followup_action.
* 효과 요약(마커 아님 — 평문): route_tree_renders_base_modal_extension_groups, base_edit_loads_and_renders_base_layout_standalone, modal_edit_renders_modal_open_standalone_no_dim, extension_edit_loads_via_layout_extensions_api, enter_edit_mode_pushes_edit_query_to_url, refresh_with_edit_query_restores_edit_mode, back_button_exits_edit_mode_to_route.
*/
import { test, expect, issueToken, authenticatePage } from '../../fixtures/auth';
@@ -58,6 +58,7 @@ async function editorNodeCount(page: import('@playwright/test').Page): Promise<n
}
test.describe('@layout-editor 별도 편집 모드', () => {
/** @effects base_edit_loads_and_renders_base_layout_standalone, enter_edit_mode_pushes_edit_query_to_url, route_tree_renders_base_modal_extension_groups */
test('base 진입 → URL ?edit= pushState + base 캔버스 단독 렌더', async ({ page }) => {
await enterEditor(page);
@@ -71,6 +72,7 @@ test.describe('@layout-editor 별도 편집 모드', () => {
await expect.poll(() => editorNodeCount(page)).toBeGreaterThan(0);
});
/** @effects back_button_exits_edit_mode_to_route */
test('base 진입 후 뒤로가기 → 편집 모드 종료(URL ?edit= 제거)', async ({ page }) => {
await enterEditor(page);
await clickTreeItem(page, /_admin_base/);
@@ -82,6 +84,7 @@ test.describe('@layout-editor 별도 편집 모드', () => {
await expect(page.locator('[data-mode="base"]')).toHaveCount(0);
});
/** @effects extension_edit_loads_via_layout_extensions_api */
test('확장 주입 그룹 항목 진입 → 확장 조각 캔버스 렌더 + URL ?edit=__extension__', async ({ page }) => {
await enterEditor(page);
@@ -93,6 +96,7 @@ test.describe('@layout-editor 별도 편집 모드', () => {
await expect.poll(() => editorNodeCount(page)).toBeGreaterThan(0);
});
/** @effects refresh_with_edit_query_restores_edit_mode */
test('?edit=__extension__ URL 직접 진입(새로고침) → 확장 편집 모드 복원', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -107,6 +111,7 @@ test.describe('@layout-editor 별도 편집 모드', () => {
await expect.poll(() => editorNodeCount(page)).toBeGreaterThan(0);
});
/** @effects modal_edit_renders_modal_open_standalone_no_dim */
test('모달 그룹 항목 진입 → 모달 단독 open 렌더', async ({ page }) => {
await enterEditor(page);
@@ -15,9 +15,10 @@
* 열어 상태 토글이 화면에 나타나는지를 확인한다 — 스펙과 라우트 평가가 실제로 만나는
* 지점은 브라우저에만 있다.
*
* @scenario route_setting × surface
* @effects editor_state_switcher_visible_on_default_shop_route
* + editor_state_switcher_visible_after_route_path_change
* 축 요약(마커 아님 — 평문): route_setting, surface. 요약을 시나리오 축 마커로 적으면 파서가
* `=` 없는 토큰을 버려 빈 조합 `{}` 이 된다.
*
* 효과 요약(마커 아님 — 평문): editor_state_switcher_visible_on_default_shop_route, editor_state_switcher_visible_after_route_path_change.
*
* 활성화 절차: PLAYWRIGHT_BASE_URL 과 PlaywrightIssueToken 발급이 가능한 환경에서
* `test.describe.skip` → `test.describe` 로 바꾼다. 상점 주소를 바꾸는 축은 이커머스
@@ -29,6 +30,7 @@ import { test, expect, issueToken, authenticatePage } from '../../fixtures/auth'
const PRODUCTS_ROUTE = '/shop/products';
test.describe.skip('레이아웃 편집기 — 상점 화면 상태 전환 노출', () => {
/** @effects editor_state_switcher_visible_on_default_shop_route */
test('기본 상점 주소에서 상태 전환 토글이 보인다', async ({ page }) => {
const token = issueToken('core.templates.layouts.edit');
await authenticatePage(page, token);
@@ -44,6 +46,7 @@ test.describe.skip('레이아웃 편집기 — 상점 화면 상태 전환 노
await expect(switcher).toBeVisible({ timeout: 20_000 });
});
/** @effects editor_state_switcher_visible_after_route_path_change */
test('상점 주소를 바꾼 사이트에서도 상태 전환 토글이 보인다', async ({ page }) => {
// 이 케이스는 basic_info.route_path 가 기본값이 아닌 환경에서만 의미가 있다.
// 검수 환경의 실제 설정값을 읽어 라우트를 만든다 — 기본값이면 위 케이스와 같아진다.
@@ -14,8 +14,8 @@
* 을 검증한다. 행/열/병합/해제/테두리/셀텍스트 round-trip 은 단위(tableGridModel.test.ts /
* TableEditor.test.tsx)가 잠그고, 본 E2E 는 구조 편집의 라이브 반영·저장을 브라우저로 확인한다.
*
* @scenario table_node_editor + add_row_col + merge + live_persist
* @effects property_modal_dispatches_table_node_editor_in_props_tab_by_kind, add_row_inserts_blank_row_keeps_col_count, add_column_inserts_blank_col, shift_select_range_then_merge_sets_origin_span_removes_absorbed, live_add_row_col_merge_save_persists_to_user_page, editor_save_specs_target_sandbox_layout_not_product_layout
* 축 요약(마커 아님 — 평문): table_node_editor, add_row_col, merge, live_persist.
* 효과 요약(마커 아님 — 평문): property_modal_dispatches_table_node_editor_in_props_tab_by_kind, add_row_inserts_blank_row_keeps_col_count, add_column_inserts_blank_col, shift_select_range_then_merge_sets_origin_span_removes_absorbed, live_add_row_col_merge_save_persists_to_user_page, editor_save_specs_target_sandbox_layout_not_product_layout.
*/
import { test, expect, issueToken, authenticatePage } from '../../fixtures/auth';
import type { Page } from '@playwright/test';
@@ -138,6 +138,7 @@ async function addTable(page: Page, sandbox = false): Promise<string> {
}
test.describe('@layout-editor table 노드 에디터(빌트인 STRUCT-TREE)', () => {
/** @effects property_modal_dispatches_table_node_editor_in_props_tab_by_kind, add_row_inserts_blank_row_keeps_col_count, add_column_inserts_blank_col */
test('Table 선택 시 table 에디터가 속성 탭에 마운트되고 행/열 추가가 grid 반영', async ({ page }) => {
await gotoEditor(page);
const tablePath = await addTable(page);
@@ -165,6 +166,7 @@ test.describe('@layout-editor table 노드 에디터(빌트인 STRUCT-TREE)', ()
expect(colsAfter).toBe(colsBefore + 1);
});
/** @effects shift_select_range_then_merge_sets_origin_span_removes_absorbed */
test('셀 선택 + Shift 영역 선택 → 병합 버튼 활성 → 병합 반영', async ({ page }) => {
await gotoEditor(page);
const tablePath = await addTable(page);
@@ -187,6 +189,7 @@ test.describe('@layout-editor table 노드 에디터(빌트인 STRUCT-TREE)', ()
// 저장(PUT)하는 테스트는 편집 결과가 그대로 영속되므로 제품 화면(home)이 아니라 E2E 전용
// 시드 화면(e2e_sandbox)을 대상으로 한다. 제품 화면에 저장하면 실행마다 빈 표가 누적된다
// (실측: 7개, 20,321 → 33,696 bytes). 시드 화면은 globalSetup 이 매 실행 원본으로 덮어쓴다.
/** @effects live_add_row_col_merge_save_persists_to_user_page, editor_save_specs_target_sandbox_layout_not_product_layout */
test('table 편집 후 저장 → PUT 200', async ({ page }) => {
await gotoEditor(page, sandboxRouteParam());
const tablePath = await addTable(page, true);
@@ -15,8 +15,8 @@
* 을 검증한다. 변형 정합(span 보정/흡수셀/밴드 이동)은 단위(TableInplaceOverlay.test.tsx /
* tableGridModel.test.ts)가 잠그고, 본 E2E 는 인플레이스 라이브 반영·저장을 브라우저로 확인.
*
* @scenario table_canvas_inplace_overlay + inplace_add_row_col + inplace_merge + live_persist
* @effects editorcanvasoverlay_dispatches_canvasoverlay_by_kind_with_measured_cellboxes, table_inplace_overlay_registered_via_registercoreeditors_kind_agnostic, inplace_gutter_add_row_col_shares_tablegridmutations_with_property_panel, inplace_shift_select_merge_sets_origin_span_removes_absorbed, live_inplace_cell_edit_save_persists_to_user_page, editor_save_specs_target_sandbox_layout_not_product_layout
* 축 요약(마커 아님 — 평문): table_canvas_inplace_overlay, inplace_add_row_col, inplace_merge, live_persist.
* 효과 요약(마커 아님 — 평문): editorcanvasoverlay_dispatches_canvasoverlay_by_kind_with_measured_cellboxes, table_inplace_overlay_registered_via_registercoreeditors_kind_agnostic, inplace_gutter_add_row_col_shares_tablegridmutations_with_property_panel, inplace_shift_select_merge_sets_origin_span_removes_absorbed, live_inplace_cell_edit_save_persists_to_user_page, editor_save_specs_target_sandbox_layout_not_product_layout.
*/
import { test, expect, issueToken, authenticatePage } from '../../fixtures/auth';
import type { Page } from '@playwright/test';
@@ -135,6 +135,7 @@ async function selectFirstCell(page: Page): Promise<boolean> {
}
test.describe('@layout-editor table 캔버스 인플레이스 오버레이(빌트인)', () => {
/** @effects editorcanvasoverlay_dispatches_canvasoverlay_by_kind_with_measured_cellboxes, table_inplace_overlay_registered_via_registercoreeditors_kind_agnostic */
test('표 선택 시 오버레이 마운트(모서리 추가) + 셀 선택 시 거터/도구 노출', async ({ page }) => {
await gotoEditor(page);
const tablePath = await addTable(page);
@@ -179,6 +180,7 @@ test.describe('@layout-editor table 캔버스 인플레이스 오버레이(빌
expect(handleGotPointerDown).toBe(true);
});
/** @effects inplace_gutter_add_row_col_shares_tablegridmutations_with_property_panel */
test('선택 셀 행/열 추가 거터 → 캔버스 행/열 증가', async ({ page }) => {
await gotoEditor(page);
const tablePath = await addTable(page);
@@ -192,6 +194,7 @@ test.describe('@layout-editor table 캔버스 인플레이스 오버레이(빌
expect(await page.locator(`[data-editor-name="Tr"]`).count()).toBeGreaterThan(rowsBefore);
});
/** @effects inplace_shift_select_merge_sets_origin_span_removes_absorbed */
test('선택 셀 오른쪽 병합 → colspan 반영', async ({ page }) => {
await gotoEditor(page);
const tablePath = await addTable(page);
@@ -218,6 +221,7 @@ test.describe('@layout-editor table 캔버스 인플레이스 오버레이(빌
// 오염 시점과 정확히 같은 크기로 되돌아왔다(편집기가 들고 있던 문서를 통째로 다시 저장).
// 그래서 원복에 기대지 않고 저장 대상 자체를 시드 화면으로 분리했다. 시드 화면은 globalSetup 이
// 매 실행 fixture 원본으로 덮어쓰므로 회차 간 누적이 성립하지 않는다.
/** @effects live_inplace_cell_edit_save_persists_to_user_page, editor_save_specs_target_sandbox_layout_not_product_layout */
test('인플레이스 편집 후 저장 → PUT 200', async ({ page }) => {
await gotoEditor(page, sandboxRouteParam());
const tablePath = await addTable(page, true);
@@ -8,8 +8,8 @@
* 실제 마운트되어 탭 헤더에 +추가/✕삭제/◀▶이동 어포던스를 노출함을 브라우저로 실증한다
* (확장점이 문서상 확장점이 아니라 실동작 경로임을 증명).
*
* @scenario template_registered_canvas_overlay + tabnav_inplace_affordances + add_remove_persist
* @effects template_registerCanvasOverlay_mounts_in_live_editor, tabnav_header_shows_add_remove_move_affordances, inplace_add_patches_node_props_tabs_same_ssot_as_property_panel
* 축 요약(마커 아님 — 평문): template_registered_canvas_overlay, tabnav_inplace_affordances, add_remove_persist.
* 효과 요약(마커 아님 — 평문): template_registerCanvasOverlay_mounts_in_live_editor, tabnav_header_shows_add_remove_move_affordances, inplace_add_patches_node_props_tabs_same_ssot_as_property_panel.
*/
import { test, expect, issueToken, authenticatePage } from '../../fixtures/auth';
import type { Page } from '@playwright/test';
@@ -76,6 +76,7 @@ async function selectByPath(page: Page, path: string): Promise<void> {
}
test.describe('@layout-editor TabNavigation 인플레이스(템플릿 registerCanvasOverlay 레퍼런스)', () => {
/** @effects template_registerCanvasOverlay_mounts_in_live_editor, tabnav_header_shows_add_remove_move_affordances, inplace_add_patches_node_props_tabs_same_ssot_as_property_panel */
test('admin 편집기에서 TabNavigation 선택 시 템플릿 등록 인플레이스 어포던스가 마운트된다', async ({ page }) => {
await gotoAdminEditor(page);
const navPath = await addTabNavigation(page);
@@ -14,8 +14,8 @@
* "버전 기록"이 활성화되어 확장 전용 버전 API 의 목록 모달이 열린다. 저장/복원 동기화는
* 단위(useExtensionDocument/리듀서/VersionHistoryModal) + 백엔드 Feature 테스트가 커버.
*
* @scenario edit_mode + layout_history + scroll_lock_source
* @effects editor_routes_response_includes_layout_versions_map + tree_version_badge_matches_versions_map + no_badge_for_layouts_without_history + modal_edit_keeps_canvas_scrollbar + extension_badge_matches_current_version + extension_mode_version_history_modal_opens
* 축 요약(마커 아님 — 평문): edit_mode, layout_history, scroll_lock_source.
* 효과 요약(마커 아님 — 평문): editor_routes_response_includes_layout_versions_map, tree_version_badge_matches_versions_map, no_badge_for_layouts_without_history, modal_edit_keeps_canvas_scrollbar, extension_badge_matches_current_version, extension_mode_version_history_modal_opens.
*/
import { test, expect, issueToken, authenticatePage } from '../../fixtures/auth';
@@ -33,6 +33,7 @@ async function enterEditor(page: import('@playwright/test').Page, url: string):
}
test.describe('@layout-editor 트리 버전 배지 + 모달 편집 스크롤 유지', () => {
/** @effects editor_routes_response_includes_layout_versions_map, tree_version_badge_matches_versions_map, no_badge_for_layouts_without_history */
test('라우트 트리 버전 배지가 routes 응답 layout_versions 맵과 1:1 정합', async ({ page }) => {
await enterEditor(page, EDITOR_URL);
await page.waitForSelector('[data-testid="g7le-route-tree-item"]', { timeout: 30_000 });
@@ -77,6 +78,7 @@ test.describe('@layout-editor 트리 버전 배지 + 모달 편집 스크롤 유
}
});
/** @effects modal_edit_keeps_canvas_scrollbar */
test('모달 편집 모드에서 body 스크롤 락이 무력화되어 캔버스 스크롤바 유지', async ({ page }) => {
await enterEditor(page, MODAL_DIRECT_URL);
await expect(page.locator('[data-mode="modal"]')).toBeAttached({ timeout: 30_000 });
@@ -101,6 +103,7 @@ test.describe('@layout-editor 트리 버전 배지 + 모달 편집 스크롤 유
expect(state.inline).not.toBe('hidden');
});
/** @effects extension_badge_matches_current_version, extension_mode_version_history_modal_opens */
test('확장 노드 버전 배지가 layout-extensions 응답 current_version 과 정합 + 확장 편집 모드 버전 기록 모달', async ({ page }) => {
await enterEditor(page, EDITOR_URL);
await page.waitForSelector('[data-testid="g7le-route-tree-item"]', { timeout: 30_000 });
@@ -10,8 +10,8 @@
* 버전 목록·복원의 응답 정합/권한 가드는 LayoutControllerTest.php 가 커버 — 본 spec 은
* 위지윅 chrome 의 버튼 활성/모달 노출/새 창 열림 책임만.
*
* @scenario toolbar_button + edit_mode + layout_name_present + versions_state + preview_result
* @effects preview_button_enabled_when_layout_selected + preview_creates_temp_record_and_opens_window_with_token + version_button_disabled_when_no_layout_name + version_modal_lists_saved_versions_with_change_summary + version_modal_empty_state_when_no_versions
* 축 요약(마커 아님 — 평문): toolbar_button, edit_mode, layout_name_present, versions_state, preview_result.
* 효과 요약(마커 아님 — 평문): preview_button_enabled_when_layout_selected, preview_creates_temp_record_and_opens_window_with_token, version_button_disabled_when_no_layout_name, version_modal_lists_saved_versions_with_change_summary, version_modal_empty_state_when_no_versions.
*/
import { test, expect, issueToken, authenticatePage } from '../../fixtures/auth';
@@ -30,6 +30,7 @@ async function enterEditor(
}
test.describe('@layout-editor version history + preview', () => {
/** @effects version_modal_lists_saved_versions_with_change_summary, version_modal_empty_state_when_no_versions */
test('🕘 버전 기록 버튼 클릭 시 모달 열림 + 목록 또는 빈 상태 노출', async ({ page }) => {
await enterEditor(page, EDITOR_URL_HOME);
await page.waitForSelector('[data-testid="g7le-preview-frame"]', { timeout: 30_000 });
@@ -57,6 +58,7 @@ test.describe('@layout-editor version history + preview', () => {
await expect(page.getByTestId('g7le-version-history')).toHaveCount(0);
});
/** @effects preview_button_enabled_when_layout_selected, preview_creates_temp_record_and_opens_window_with_token */
test('👁 미리보기 버튼 클릭 시 /preview/{token} 새 창 열림', async ({ page, context }) => {
await enterEditor(page, EDITOR_URL_HOME);
await page.waitForSelector('[data-testid="g7le-preview-frame"]', { timeout: 30_000 });
@@ -77,6 +79,7 @@ test.describe('@layout-editor version history + preview', () => {
await popup.close();
});
/** @effects version_button_disabled_when_no_layout_name */
test('라우트 미선택 시 버전/미리보기 버튼 비활성', async ({ page }) => {
await enterEditor(page, EDITOR_URL_NO_ROUTE);
// 라우트 미선택 상태(layoutName 없음) — 두 버튼 모두 disabled
@@ -0,0 +1,158 @@
/**
* E2E: 레이아웃 표현식 평가 샌드박스 (배포 번들 기준, KVE-2026-1915)
*
* 배경: 표현식 평가가 `new Function`/`with(ctx)` 로 실행되어
* `''.constructor.constructor('code')()` 형태의 샌드박스 탈출이 가능했다.
* engine-v1.59.0 에서 화이트리스트 AST 평가기(SafeExpressionEvaluator)로 교체했다.
*
* 단위 테스트(SafeExpressionEvaluator.test.ts)가 소스 레벨을 잠그지만, 실제 사용자가
* 실행하는 것은 빌드된 번들이므로 브라우저에서 배포 번들의 공개 API(`G7Core.evaluateCondition`)를
* 그대로 호출해 (a) 정상 표현식 회귀 없음 + (b) 익스플로잇 미실행 양면을 잠근다.
*
* 시나리오 축(case)·효과는 매니페스트 tests/scenarios/layout-expression-sandbox.yaml 참조.
* 각 test 의 `// @scenario case=…` 라인 마커가 축 조합을, `// @effects …` 가 효과를 커버한다.
*
* 효과 목록을 이 파일 레벨에 몰아 적지 않는다 — 커버리지 룰은 마커 레벨을 구분하지 않으므로,
* 파일 레벨 목록이 있으면 해당 test 를 지워도 효과가 "언급됨" 으로 집계돼 삭제가 무증상 green
* 이 된다. 마커는 test 에만 둔다.
*/
import { test, expect } from '../fixtures/auth';
test.describe('레이아웃 표현식 평가 샌드박스', () => {
test.beforeEach(async ({ page }) => {
// 코어 번들이 부팅된 화면이면 충분하다(로그인 화면도 엔진을 부팅한다).
await page.goto('/admin/login');
await page.waitForFunction(
() => typeof (window as any).G7Core?.evaluateCondition === 'function',
null,
{ timeout: 30_000 },
);
});
// @scenario case=safe_expression
// @effects same_expression_same_value_across_paths
test('정상 표현식(삼항·옵셔널체이닝·nullish)이 배포 번들에서 정상 평가된다', async ({ page }) => {
const result = await page.evaluate(() => {
const g7 = (window as any).G7Core;
const ctx = { user: { name: '홍길동' }, count: 2 };
return {
ternary: g7.evaluateCondition('{{user?.name ? true : false}}', ctx),
nullish: g7.evaluateCondition('{{(user?.missing ?? "fallback") === "fallback"}}', ctx),
compare: g7.evaluateCondition('{{count > 1}}', ctx),
};
});
expect(result.ternary).toBe(true);
expect(result.nullish).toBe(true);
expect(result.compare).toBe(true);
});
// @scenario case=arrow_template_literal
// @effects same_expression_same_value_across_paths
test('화살표 함수·스프레드·템플릿 리터럴·new Date 가 배포 번들에서 동작한다', async ({ page }) => {
const result = await page.evaluate(() => {
const g7 = (window as any).G7Core;
const ctx = { items: [{ v: 'a' }, { v: 'b' }, { v: 'a' }], $args: ['x'] };
return {
// 화살표 함수 + includes
arrow: g7.evaluateCondition("{{(items ?? []).filter(i => i.v === 'a').length === 2}}", ctx),
// 스프레드 + Set + Array.from(new Set(...))
spreadSet: g7.evaluateCondition("{{Array.from(new Set((items ?? []).map(i => i.v))).length === 2}}", ctx),
// 템플릿 리터럴 (내비게이션 경로 조립 형태)
template: g7.evaluateCondition('{{`/mypage/${$args[0]}` === "/mypage/x"}}', ctx),
// new Date
date: g7.evaluateCondition('{{new Date("2020-01-01").getTime() > 0}}', ctx),
};
});
expect(result.arrow).toBe(true);
expect(result.spreadSet).toBe(true);
expect(result.template).toBe(true);
expect(result.date).toBe(true);
});
// @scenario case=constructor_escape
// @effects sandbox_escape_blocked, dangerous_payload_does_not_set_global
test('constructor 체인 샌드박스 탈출이 코드를 실행하지 못한다', async ({ page }) => {
const result = await page.evaluate(() => {
const g7 = (window as any).G7Core;
// 익스플로잇: 성공하면 window.__g7jsi 전역이 설정된다.
delete (window as any).__g7jsi;
const payloads = [
"{{''.constructor.constructor('window.__g7jsi = 1')()}}",
"{{''['constructor']['constructor']('window.__g7jsi = 2')()}}",
'{{({}).__proto__}}',
"{{Function('window.__g7jsi = 3')()}}",
];
// 각 페이로드를 평가 — 평가기는 거부(예외→false)해야 하며 코드는 실행되지 않아야 한다.
const results = payloads.map((p) => {
try {
return g7.evaluateCondition(p, {});
} catch {
return false;
}
});
return {
globalSet: (window as any).__g7jsi !== undefined,
allBlocked: results.every((r) => !r),
};
});
// 익스플로잇 코드가 실행되지 않았다(전역 canary 미설정).
expect(result.globalSet).toBe(false);
// 위험 표현식은 truthy 로 평가되지 않는다(거부).
expect(result.allBlocked).toBe(true);
});
// @scenario case=nonstring_key_escape
// @effects sandbox_escape_blocked, dangerous_payload_does_not_set_global
test('비-문자열 computed 키·Object 리플렉션 탈출이 배포 번들에서 코드를 실행하지 못한다', async ({ page }) => {
const result = await page.evaluate(() => {
const g7 = (window as any).G7Core;
delete (window as any).__g7jsi;
const payloads = [
// 배열 키가 ToPropertyKey 강제변환으로 constructor 도달 (engine-v1.60.1 이전 우회)
"{{''[['constructor']][['constructor']]('window.__g7jsi = 1')()}}",
// 문자열 조립 난독화 — 정적 룰이 못 잡는 형태(런타임 정규화가 최종 게이트)
"{{''[['const' + 'ructor']][['const' + 'ructor']]('window.__g7jsi = 2')()}}",
// 객체 toString 강제변환 키
"{{''[{ toString: () => 'constructor' }]}}",
// Object 리플렉션 static 으로 Function 도달
"{{Object.getOwnPropertyDescriptor(Object.getPrototypeOf(String), 'constructor').value('window.__g7jsi = 3')()}}",
// 프로토타입 오염 시도
'{{Object.setPrototypeOf({}, { polluted: 1 })}}',
];
const results = payloads.map((p) => {
try {
return g7.evaluateCondition(p, {});
} catch {
return false;
}
});
return {
globalSet: (window as any).__g7jsi !== undefined,
allBlocked: results.every((r) => !r),
};
});
expect(result.globalSet).toBe(false);
expect(result.allBlocked).toBe(true);
});
// @scenario case=object_facade_safe
// @effects same_expression_same_value_across_paths
test('안전한 Object 데이터 메서드(keys/assign/create)가 배포 번들에서 정상 동작한다', async ({ page }) => {
const result = await page.evaluate(() => {
const g7 = (window as any).G7Core;
const ctx = { o: { a: 1, b: 2 }, base: { x: 1 }, k: 'y', v: 2 };
return {
keys: g7.evaluateCondition("{{Object.keys(o).join(',') === 'a,b'}}", ctx),
// 실제 레이아웃(_tab_reviews.json)의 필터 맵 생성 패턴
createAssign: g7.evaluateCondition('{{Object.assign(Object.create(null), base, { [k]: v }).y === 2}}', ctx),
};
});
expect(result.keys).toBe(true);
expect(result.createAssign).toBe(true);
});
});
@@ -0,0 +1,122 @@
/**
* E2E: 레이아웃 외부 스크립트 신뢰 출처 허용목록 (배포 번들 기준, KVE-2026-1915)
*
* 배경: B-2 원격 스크립트 차단이 same-origin 이 아닌 모든 스크립트를 무조건 막아
* 번들 확장(CKEditor5 cdn.ckeditor.com, Daum 우편번호 t1.daumcdn.net)의 CDN 스크립트까지
* 깨뜨렸다. 확장이 manifest(`trusted_script_hosts`)로 선언한 호스트를 코어가 집계해
* `window.G7Config.trustedScriptHosts` 로 노출하고, 런타임 스크립트 로더가 그 목록만
* 예외로 허용하도록 고쳤다.
*
* 이 스펙은 서버→블레이드→배포 번들로 이어지는 주입 배선이 실제로 연결돼 있는지
* (G7Config.trustedScriptHosts 노출), 활성 확장의 선언이 그 목록에 반영되는지, 그리고
* 실제 화면 로드에서 신뢰 목록 밖 외부 스크립트가 하나도 실행되지 않는지(차단 관찰)를 잠근다.
*
* 차단 결정 함수(isAllowedScriptSrc) 자체는 minify 된 배포 번들에서 이름으로 호출할 수 없어
* 단위 스위트(TemplateApp.scriptSrc.test.ts)가 고정한다. 이 스펙은 그 결정의
* 관찰 가능한 결과 — "실제 페이지에 same-origin/신뢰호스트 외 스크립트가 로드되지 않음" —
* 을 네트워크 레벨에서 무조건 측정한다.
*
* authority 우회(`/\/evil.com/x.js` · 탭·개행 삽입)도 이 관찰에 포함된다. 그 형태는
* 브라우저가 외부 origin 으로 해석하므로, 판정이 뚫리면 네트워크에 cross-origin script
* 요청으로 나타나 아래 offenders 단언에 걸린다 — 요청 URL 은 이미 해석된 절대 URL 이라
* 우회 문자열 형태와 무관하게 origin 으로 판정된다.
*
* 시나리오 축(case)·효과는 매니페스트 tests/scenarios/trusted-script-hosts.yaml 참조.
* 각 test 의 `// @scenario case=…` 라인 마커가 축 조합을, `// @effects …` 가 효과를 커버한다.
*
* 효과 목록을 이 파일 레벨에 몰아 적지 않는다 — 커버리지 룰은 마커 레벨을 구분하지 않으므로,
* 파일 레벨 목록이 있으면 해당 test 를 지워도 효과가 "언급됨" 으로 집계돼 삭제가 무증상 green
* 이 된다. 마커는 test 에만 둔다.
*/
import { test, expect } from '../fixtures/auth';
test.describe('레이아웃 외부 스크립트 신뢰 출처 허용목록', () => {
test.beforeEach(async ({ page }) => {
await page.goto('/admin/login');
await page.waitForFunction(
() => typeof (window as any).G7Config !== 'undefined',
null,
{ timeout: 30_000 },
);
});
// @scenario case=trusted_hosts_exposed_in_config
// @effects trusted_script_host_allowlist_wired
test('배포 번들에 G7Config.trustedScriptHosts 가 배열로 노출된다', async ({ page }) => {
const shape = await page.evaluate(() => {
const hosts = (window as any).G7Config?.trustedScriptHosts;
return { isArray: Array.isArray(hosts), allStrings: Array.isArray(hosts) && hosts.every((h: unknown) => typeof h === 'string') };
});
expect(shape.isArray).toBe(true);
expect(shape.allStrings).toBe(true);
});
// @scenario case=active_extension_host_reflected
// @effects trusted_script_host_allowlist_wired
test('활성 확장이 선언한 신뢰 호스트가 허용목록에 반영된다', async ({ page }) => {
const result = await page.evaluate(() => {
const cfg = (window as any).G7Config ?? {};
const hosts: string[] = Array.isArray(cfg.trustedScriptHosts) ? cfg.trustedScriptHosts : [];
const plugins: Array<{ identifier?: string }> = Array.isArray(cfg.activePlugins) ? cfg.activePlugins : [];
const has = (id: string) => plugins.some((p) => p.identifier === id);
return {
ckeditorActive: has('sirsoft-ckeditor5'),
daumActive: has('sirsoft-daum_postcode'),
hasCkeditorHost: hosts.includes('cdn.ckeditor.com'),
hasDaumHost: hosts.includes('t1.daumcdn.net'),
};
});
// 확장이 활성일 때만 그 선언 호스트가 목록에 있어야 한다(비활성이면 스킵 — 서버 상태 독립).
if (result.ckeditorActive) {
expect(result.hasCkeditorHost).toBe(true);
}
if (result.daumActive) {
expect(result.hasDaumHost).toBe(true);
}
});
// @scenario case=untrusted_external_script_not_loaded
// @effects untrusted_external_script_blocked
test('실제 화면 로드에서 same-origin·신뢰호스트 외 스크립트는 하나도 로드되지 않는다', async ({ page }) => {
// 새 로드의 모든 script 네트워크 요청을 수집한다
const scriptUrls: string[] = [];
page.on('request', (req) => {
if (req.resourceType() === 'script') {
scriptUrls.push(req.url());
}
});
// beforeEach 가 이미 진입한 화면을 다시 로드해 엔진 부팅부터의 스크립트 요청을 포착한다
await page.reload({ waitUntil: 'networkidle' });
const cfg = await page.evaluate(() => ({
origin: window.location.origin,
hosts: (Array.isArray((window as any).G7Config?.trustedScriptHosts)
? (window as any).G7Config.trustedScriptHosts
: []) as string[],
}));
const trusted = new Set(cfg.hosts.map((h) => h.toLowerCase()));
// 측정 대상이 실제로 존재하는지(공허한 통과 방지) 확인 — 최소한 번들 스크립트는 로드된다
expect(scriptUrls.length).toBeGreaterThan(0);
const offenders = scriptUrls.filter((url) => {
let u: URL;
try {
u = new URL(url);
} catch {
return false; // 파싱 불가 URL 은 판정 대상 아님
}
if (u.protocol !== 'http:' && u.protocol !== 'https:') {
return false; // data:/blob: 등은 별개 축
}
const sameOrigin = u.origin === cfg.origin;
const trustedHost = trusted.has(u.hostname.toLowerCase());
return ! sameOrigin && ! trustedHost;
});
expect(offenders, `허용되지 않은 외부 스크립트가 로드됨: ${offenders.join(', ')}`).toEqual([]);
});
});
@@ -195,7 +195,13 @@ test('@smoke #399 Phase 1.8 - admin 페이지 헤더의 refresh 버튼이 .btn-i
// Phase 1.8: page_header 안의 refresh_button 이 인라인 Tailwind 5토큰에서
// 표준 .btn-icon 시맨틱 자산으로 통합됐는지 확인.
await expect(page.locator('#refresh_button').first()).toHaveClass(/btn-icon/);
//
// 마운트 대기는 형제 검증(Phase 1.7 의 10s, admin-role-list-refresh.spec 의 15s)과 같은
// 폭으로 맞춘다 — 기본 5s 로 두면 여러 spec 이 병렬로 도는 실행에서 SPA 마운트가 5s 를
// 넘겨 간헐 red 가 난다(클래스 불일치가 아니라 element not found 로 나타나 오진하기 쉽다).
const refreshButton = page.locator('#refresh_button').first();
await refreshButton.waitFor({ state: 'visible', timeout: 15_000 });
await expect(refreshButton).toHaveClass(/btn-icon/);
// Phase 1.9: page_header 의 우측 버튼 묶음 컨테이너가
// 인라인 'flex items-center gap-2' 가 아닌 기존 시맨틱 .flex-center 를 활용한