@@ -24,7 +24,7 @@ describe('useThemeConfig', () => {
2424 } ) ;
2525
2626 describe ( 'when `siteConfig.theme` is present' , ( ) => {
27- it ( 'returns empty object if at least one variant is not defined' , ( ) => {
27+ it ( 'returns empty object if core is not defined and no variants are defined' , ( ) => {
2828 jest . spyOn ( config , 'getSiteConfig' ) . mockReturnValue ( {
2929 ...baseSiteConfig ,
3030 theme : {
@@ -35,7 +35,25 @@ describe('useThemeConfig', () => {
3535 const { result } = renderHook ( ( ) => useThemeConfig ( ) ) ;
3636 expect ( result . current ) . toStrictEqual ( { } ) ;
3737 } ) ;
38- it ( 'returns expected object when nothing but the light variant is defined' , ( ) => {
38+ it ( 'returns expected object when only core is defined' , ( ) => {
39+ jest . spyOn ( config , 'getSiteConfig' ) . mockReturnValue ( {
40+ ...baseSiteConfig ,
41+ theme : {
42+ core : {
43+ url : 'core.css' ,
44+ } ,
45+ } ,
46+ } ) ;
47+ const { result } = renderHook ( ( ) => useThemeConfig ( ) ) ;
48+ expect ( result . current ) . toStrictEqual ( {
49+ core : {
50+ url : 'core.css' ,
51+ } ,
52+ defaults : undefined ,
53+ variants : undefined ,
54+ } ) ;
55+ } ) ;
56+ it ( 'returns expected object when only a light variant is defined' , ( ) => {
3957 jest . spyOn ( config , 'getSiteConfig' ) . mockReturnValue ( {
4058 ...baseSiteConfig ,
4159 theme : {
@@ -53,7 +71,6 @@ describe('useThemeConfig', () => {
5371 }
5472 } ) ;
5573 } ) ;
56-
5774 it ( 'returns expected object when configuration is valid' , ( ) => {
5875 jest . spyOn ( config , 'getSiteConfig' ) . mockReturnValue ( {
5976 ...baseSiteConfig ,
0 commit comments