@@ -109,6 +109,32 @@ test('design system story stats match flattened catalog', () => {
109109 assert . ok ( stats . storyCount >= 10 ) ;
110110} ) ;
111111
112+ test ( 'storybook public catalog excludes full business components' , async ( ) => {
113+ const storybookConfigSource = await readFile ( new URL ( '../../../.storybook/main.ts' , import . meta. url ) , 'utf8' ) ;
114+ const storybookStoryPaths = Array . from ( storybookConfigSource . matchAll ( / ' ( [ ^ ' ] + \. s t o r i e s \. \@ \( t s \| t s x \| m d x \) ) ' / g) )
115+ . map ( ( match ) => match [ 1 ] ) ;
116+ const featureComponentGroup = getCatalogGroup ( 'feature-components' ) ;
117+
118+ assert . deepEqual ( storybookStoryPaths , [
119+ '../src/stories/tokens/**/*.stories.@(ts|tsx|mdx)' ,
120+ '../src/stories/primitives/**/*.stories.@(ts|tsx|mdx)' ,
121+ '../src/components/ui/**/*.stories.@(ts|tsx|mdx)' ,
122+ ] ) ;
123+ assert . doesNotMatch ( storybookConfigSource , / \. \. \/ s r c \/ \* \* \/ \* \. s t o r i e s / ) ;
124+ assert . doesNotMatch ( storybookConfigSource , / f e a t u r e s \/ \* \* / ) ;
125+ assert . ok ( featureComponentGroup , 'business design-system catalog stays assigned to the 5173 app entry' ) ;
126+
127+ for ( const story of featureComponentGroup . stories ) {
128+ assert . match ( story . path , / f r o n t e n d \/ s r c \/ f e a t u r e s \/ / , `${ story . path } must stay in the 5173 business design-system catalog` ) ;
129+ assert . match ( story . storybookTitle , / D e s i g n S y s t e m \/ 业 务 组 件 / , `${ story . storybookTitle } must remain a business design-system title` ) ;
130+ }
131+
132+ for ( const story of flattenDesignSystemStories ( designSystemStoryGroups ) . filter ( ( item ) => item . path . includes ( '/components/ui/' ) || item . path . includes ( '/stories/' ) ) ) {
133+ assert . doesNotMatch ( story . path , / f r o n t e n d \/ s r c \/ f e a t u r e s \/ / , `${ story . path } must stay out of the public Storybook catalog` ) ;
134+ assert . doesNotMatch ( story . storybookTitle , / D e s i g n S y s t e m \/ 业 务 组 件 / , `${ story . storybookTitle } must stay out of Storybook 6006` ) ;
135+ }
136+ } ) ;
137+
112138test ( 'modal frame is admitted as a shared design-system component' , ( ) => {
113139 const componentsGroup = getCatalogGroup ( 'components' ) ;
114140 assert . ok ( componentsGroup ) ;
0 commit comments