docs(storybook): make Expanded OrgChart a preview-only page
Deploy Storybook / deploy (push) Successful in 59s
Deploy Storybook / deploy (push) Successful in 59s
Remove the data, layout, interaction and employee-popup setting panels from the Expanded OrgChart Story. The chart now renders a fixed sample (7 companies x 20, TB, all expanded, collapse/zoom/pan on, Drag & Drop off, HM Dialog) right under the page title. Story ID, OrgChart packages and public API are unchanged. Align the Story browser checks (P7, P8, P9, P9.2-P9.5, geometry, popup parity, hierarchy, HM Story) with the preview: setting-only scenarios are removed, chart rendering, collapse, Zoom/Pan/Fit and HM Dialog checks run on the fixed state. Move/Drag & Drop coverage stays in the Vanilla Core checks (verify-p9-3-core, verify-p9-4-core). Verified: tsc, test:guard 94/94, node --check on 11 scripts, changed browser sections PASS. Pre-existing P7 story-menu, P8 Department long-name, P9 Expanded tb/runner failures remain separate issues. verify-p9-5-popup-parity was not run (needs the Vanilla example server).
This commit is contained in:
1 parent
4a54cfbeb2
commit
f4ddd5ac4b
14 files changed
+163
-1134
No files matched your search
@@ -63,7 +63,7 @@ async function ready(expected) {
|
||||
async function gotoStory(story, width = 1440) {
|
||||
await page.setViewportSize({ width, height: 1100 });
|
||||
await page.goto(`${origin}/iframe.html?id=${story.id}&viewMode=story`);
|
||||
await ready(story.file === 'expanded-org-chart' ? 20 : undefined);
|
||||
await ready(story.file === 'expanded-org-chart' ? 140 : undefined);
|
||||
}
|
||||
async function capture(file, fullPage = true) { await page.screenshot({ path: path.join(output, file + '.png'), fullPage }); }
|
||||
async function section(name, work) {
|
||||
@@ -140,12 +140,6 @@ const fixedHasNoInternalScroll = fixed => fixed.scroll.filter(item => !item.miss
|
||||
? item.overflowX === 'hidden' && item.overflowY === 'hidden'
|
||||
: item.scrollWidth <= item.clientWidth + 1 && item.scrollHeight <= item.clientHeight + 1
|
||||
));
|
||||
async function select(label, option) {
|
||||
await page.getByRole('combobox', { name: label, exact: true }).click();
|
||||
await page.getByRole('option', { name: option, exact: true }).click();
|
||||
await settle();
|
||||
}
|
||||
|
||||
try {
|
||||
await section('manager', async () => {
|
||||
const response = await page.request.get(origin + '/index.json');
|
||||
@@ -294,33 +288,19 @@ try {
|
||||
});
|
||||
await section('smoke', async () => {
|
||||
await gotoStory(stories[3]);
|
||||
for (const label of ['데이터 범위', '전체 직원 수', '조직도 표시 유형', '혼합형 시작 Depth', '특정 그룹 세로 배치', '초기 표시 Depth', '직원 정보 팝업']) check(await page.getByRole('combobox', { name: label, exact: true }).count() === 1, `Expanded: ${label} control preserved`);
|
||||
for (const label of ['접기·펼치기 사용', 'Zoom 사용', 'Pan 사용']) check(await page.getByRole('checkbox', { name: label, exact: true }).isChecked(), `Expanded: independent ${label} control enabled`);
|
||||
check(await page.getByRole('checkbox').count() === 10 && await page.getByRole('button', { name: '데이터 적용', exact: true }).count() === 1 && await page.getByRole('button', { name: '초기화', exact: true }).count() === 1, 'Expanded: seven company selections and apply/reset actions preserved');
|
||||
await select('전체 직원 수', '100명');
|
||||
check((await autoState()).employees === 20, 'Expanded: draft count waits for data apply');
|
||||
await page.getByRole('button', { name: '데이터 적용', exact: true }).click(); await ready(100);
|
||||
check((await autoState()).employees === 100 && (await page.locator('[data-component="OrgChartExampleCounts"]').textContent()).includes('100'), 'Expanded: data apply renders 100 employee records');
|
||||
for (const [option, type] of [['세로형 TB', 'tb'], ['가로형 LR', 'lr'], ['혼합형 Hybrid', 'hybrid']]) {
|
||||
await select('조직도 표시 유형', option); await ready(100);
|
||||
const state = await autoState();
|
||||
check(state.type === type && state.employees === 100 && autoFits(state), `Expanded: ${type} switch preserves data and Fit`, state);
|
||||
}
|
||||
await select('초기 표시 Depth', '2Depth까지'); await ready();
|
||||
const depths = await page.locator('.node[data-depth]').evaluateAll(nodes => nodes.map(node => Number(node.dataset.depth)));
|
||||
check(depths.every(depth => depth < 2), 'Expanded: initial Depth control still limits visible groups', depths);
|
||||
await select('초기 표시 Depth', '전체 펼침'); await ready(100);
|
||||
// Expanded is preview-only (2026-10-22): settings, data apply, layout/Depth switches and the
|
||||
// independent Zoom/Pan checkboxes were removed; the fixed 7x20 TB preview keeps chart browsing.
|
||||
check(await page.getByRole('combobox').count() === 0 && await page.getByRole('checkbox').count() === 0 && await page.getByRole('switch').count() === 0, 'Expanded: preview-only page has no setting controls');
|
||||
const preview = await autoState();
|
||||
check(preview.type === 'tb' && preview.employees === 140 && preview.zoomEnabled === 'true' && preview.panEnabled === 'true', 'Expanded: fixed TB 140 employee preview with Zoom/Pan enabled', preview);
|
||||
const beforeCollapse = await autoState();
|
||||
const toggle = page.locator('.hm-orgchart-expanded-toggle').first();
|
||||
const organizationId = await toggle.getAttribute('data-organization-id');
|
||||
await toggle.focus(); await toggle.press('Enter'); await ready();
|
||||
const collapsed = await autoState();
|
||||
check(await toggle.getAttribute('aria-expanded') === 'false' && collapsed.organizations < beforeCollapse.organizations && collapsed.employees < beforeCollapse.employees, 'Expanded: Enter collapses a group and its descendants', { organizationId, before: beforeCollapse, after: collapsed });
|
||||
await page.locator(`.hm-orgchart-expanded-toggle[data-organization-id="${organizationId}"]`).press('Space'); await ready(100);
|
||||
await page.locator(`.hm-orgchart-expanded-toggle[data-organization-id="${organizationId}"]`).press('Space'); await ready(140);
|
||||
check(await page.locator(`.hm-orgchart-expanded-toggle[data-organization-id="${organizationId}"]`).getAttribute('aria-expanded') === 'true', 'Expanded: Space expands the same group');
|
||||
await page.getByRole('checkbox', { name: 'Zoom 사용', exact: true }).uncheck(); await ready();
|
||||
check((await autoState()).zoomEnabled === 'false' && await page.getByRole('button', { name: '확대', exact: true }).isDisabled(), 'Expanded: independent Zoom switch disables only Zoom action');
|
||||
await page.getByRole('checkbox', { name: 'Zoom 사용', exact: true }).check(); await ready();
|
||||
await page.getByRole('button', { name: '100% 복원', exact: true }).click();
|
||||
const beforeZoom = await autoState();
|
||||
await page.getByRole('button', { name: '확대', exact: true }).click(); await settle();
|
||||
@@ -332,9 +312,6 @@ try {
|
||||
await page.mouse.move(viewport.x + 10, viewport.y + 10); await page.mouse.down(); await page.mouse.move(viewport.x + 50, viewport.y + 35); await page.mouse.up(); await settle();
|
||||
const afterPan = await autoState();
|
||||
check(afterPan.x !== beforePan.x && afterPan.y !== beforePan.y, 'Expanded: pointer Pan changes both forest coordinates', { before: beforePan, after: afterPan });
|
||||
await page.getByRole('checkbox', { name: 'Pan 사용', exact: true }).uncheck(); await ready();
|
||||
check((await autoState()).panEnabled === 'false' && (await autoState()).zoomEnabled === 'true', 'Expanded: independent Pan switch leaves Zoom enabled');
|
||||
await page.getByRole('checkbox', { name: 'Pan 사용', exact: true }).check(); await ready();
|
||||
await page.getByRole('button', { name: 'Fit to View', exact: true }).click(); await settle();
|
||||
check(autoFits(await autoState()), 'Expanded: toolbar Fit contains complete forest');
|
||||
const employee = page.locator('.hm-orgchart-employee').first(), employeeId = await employee.getAttribute('data-employee-id');
|
||||
|
||||
Reference in new issue
Block a user