@@ -5,10 +5,12 @@ import type { Options } from 'storybook/internal/types';
55function createMockOptions ( {
66 featureFlag = false ,
77 hasManifests = false ,
8+ hasLegacyComponentManifestGenerator = false ,
89 hasFeaturesObject = true ,
910} : {
1011 featureFlag ?: boolean ;
1112 hasManifests ?: boolean ;
13+ hasLegacyComponentManifestGenerator ?: boolean ;
1214 hasFeaturesObject ?: boolean ;
1315} = { } ) : Options {
1416 return {
@@ -20,7 +22,12 @@ function createMockOptions({
2022 : { } ;
2123 }
2224 if ( key === 'experimental_manifests' ) {
23- return hasManifests ? vi . fn ( ) : undefined ;
25+ return hasManifests
26+ ? { components : { v : 1 , components : { } } }
27+ : undefined ;
28+ }
29+ if ( key === 'experimental_componentManifestGenerator' ) {
30+ return hasLegacyComponentManifestGenerator ? vi . fn ( ) : undefined ;
2431 }
2532 return undefined ;
2633 } ) ,
@@ -31,12 +38,18 @@ function createMockOptions({
3138describe ( 'getManifestStatus' , ( ) => {
3239 it . each ( [
3340 {
34- description : 'both feature flag and generator are present' ,
41+ description : 'both feature flag and manifests are present' ,
3542 options : { featureFlag : true , hasManifests : true } ,
3643 expected : { available : true , hasManifests : true , hasFeatureFlag : true } ,
3744 } ,
3845 {
39- description : 'missing generator (unsupported framework)' ,
46+ description :
47+ 'both feature flag and legacy component manifest generator are present' ,
48+ options : { featureFlag : true , hasLegacyComponentManifestGenerator : true } ,
49+ expected : { available : true , hasManifests : true , hasFeatureFlag : true } ,
50+ } ,
51+ {
52+ description : 'missing manifests (unsupported framework)' ,
4053 options : { featureFlag : true , hasManifests : false } ,
4154 expected : { available : false , hasManifests : false , hasFeatureFlag : true } ,
4255 } ,
0 commit comments