refactor(storybook): simplify component and preview examples
Drop page / section descriptions, state notes and repeated captions from the representative Stories of 44 components, the Patterns, Center Graphic and OrgChart pages. Value readouts, spec lists and captions hide only on the representative page; hidden verification Stories keep them. Tabs Default API and the Filter Bar draft / applied counts move to the hidden DefaultApi and DraftApplied Stories; Center Overview is hidden with its direct URL kept. Story IDs are unchanged. Align the component, pattern and OrgChart docs with the pages, point the quality reference check at the DraftApplied Story, and make the P8 styles check expect no section header on the preview-only Expanded page.
This commit is contained in:
1 parent
48977e7823
commit
4c29894e56
81 files changed
+520
-671
No files matched your search
@@ -219,11 +219,16 @@ try {
|
||||
}
|
||||
const reference = references[0].style;
|
||||
check(references.every(item => JSON.stringify(item.style) === JSON.stringify(reference)), 'Three existing Pattern pages share the measured StoryPage frame', references);
|
||||
// Expanded OrgChart is preview-only (no StorySection since f4ddd5a): its section elements must be absent (null),
|
||||
// every other selector still has to match the Pattern pages.
|
||||
const sectionless = ['.sb-page-section', '.sb-page-section-header', '.sb-page-section-title'];
|
||||
for (const story of stories) {
|
||||
await gotoStory(story);
|
||||
const style = await commonStyle();
|
||||
const previewOnly = story.file === 'expanded-org-chart';
|
||||
const expected = previewOnly ? { ...reference, ...Object.fromEntries(sectionless.map(selector => [selector, null])) } : reference;
|
||||
measurements.push({ name: story.name + ' common StoryPage computed styles', style });
|
||||
check(JSON.stringify(style) === JSON.stringify(reference), story.name + ': StoryPage title, spacing, section and inner styles match Pattern pages', { reference: patterns[0], difference: Object.keys(reference).filter(key => JSON.stringify(reference[key]) !== JSON.stringify(style[key])), style });
|
||||
check(JSON.stringify(style) === JSON.stringify(expected), story.name + (previewOnly ? ': StoryPage title and inner styles match Pattern pages; no section header' : ': StoryPage title, spacing, section and inner styles match Pattern pages'), { reference: patterns[0], difference: Object.keys(expected).filter(key => JSON.stringify(expected[key]) !== JSON.stringify(style[key])), style });
|
||||
await capture(story.file + '-1440');
|
||||
if (['full-composition', 'expanded-org-chart'].includes(story.file)) {
|
||||
const shielding = await page.evaluate(() => {
|
||||
|
||||
Reference in new issue
Block a user