@@ -91,36 +91,51 @@ const filepaths = [
9191 'scss/components/treeview' ,
9292 'scss/components/ui-shell' ,
9393] ;
94- describe . each ( filepaths ) ( '%s' , ( filepath ) => {
95- it ( 'should be importable' , async ( ) => {
96- await expect ( render ( `@use '../${ filepath } ';` ) ) . resolves . toBeDefined ( ) ;
94+
95+ describe ( '@carbon/styles' , ( ) => {
96+ describe . each ( filepaths ) ( '%s' , ( filepath ) => {
97+ it ( 'should be importable' , async ( ) => {
98+ await expect ( render ( `@use '../${ filepath } ';` ) ) . resolves . toBeDefined ( ) ;
99+ } ) ;
97100 } ) ;
98- } ) ;
99101
100- describe ( 'Snapshot Tests' , ( ) => {
101- it ( 'should match snapshots' , async ( ) => {
102+ it ( 'should have stable public scss entrypoints' , async ( ) => {
102103 expect ( filepaths ) . toMatchSnapshot ( ) ;
103104 } ) ;
104- } ) ;
105105
106- describe ( '@carbon/styles/ scss/config' , ( ) => {
107- test ( 'Config overrides' , async ( ) => {
108- const { get } = await render ( `
109- @use 'sass:meta';
110- @use '../scss/config' with (
111- $prefix: 'custom-prefix',
112- $css--font-face: false,
113- );
106+ describe ( 'scss/config' , ( ) => {
107+ test ( 'config overrides' , async ( ) => {
108+ const { get } = await render ( `
109+ @use 'sass:meta';
110+ @use '../scss/config' with (
111+ $prefix: 'custom-prefix',
112+ $css--font-face: false,
113+ );
114114
115- $_: get('config', (
116- prefix: config.$prefix,
117- css--font-face: config.$css--font-face,
118- ));
119- ` ) ;
115+ $_: get('config', (
116+ prefix: config.$prefix,
117+ css--font-face: config.$css--font-face,
118+ ));
119+ ` ) ;
120+
121+ expect ( get ( 'config' ) . value ) . toEqual ( {
122+ prefix : 'custom-prefix' ,
123+ [ 'css--font-face' ] : false ,
124+ } ) ;
125+ } ) ;
126+ } ) ;
120127
121- expect ( get ( 'config' ) . value ) . toEqual ( {
122- prefix : 'custom-prefix' ,
123- [ 'css--font-face' ] : false ,
128+ describe ( 'import order' , ( ) => {
129+ it ( 'should support bringing in stylesheets independently' , async ( ) => {
130+ await expect (
131+ render ( `
132+ @use '../scss/reset';
133+ @use '../scss/grid';
134+ @use '../scss/breakpoint';
135+ @use '../scss/colors';
136+ @use '../scss/components';
137+ ` )
138+ ) . resolves . not . toThrow ( ) ;
124139 } ) ;
125140 } ) ;
126141} ) ;
0 commit comments