@@ -63,13 +63,15 @@ describe('theme component map', () => {
6363 const beforeData = JSON . parse ( fs . readFileSync ( path . join ( testThemePath , 'component.manifest.json' ) , 'utf8' ) )
6464 expect ( beforeData . files . assets [ 'missing.css' ] ) . to . be . undefined
6565 expect ( beforeData . files . snippets [ 'missing.liquid' ] ) . to . be . undefined
66+ expect ( beforeData . files . snippets [ 'missing-subfolder.liquid' ] ) . to . be . undefined
6667
6768 await runCommand ( [ 'theme' , 'component' , 'map' , testThemePath ] )
6869
6970 // Check that missing entries are present in map
7071 const data = JSON . parse ( fs . readFileSync ( path . join ( testThemePath , 'component.manifest.json' ) , 'utf8' ) )
7172 expect ( data . files . assets [ 'missing.css' ] ) . to . equal ( '@theme' )
7273 expect ( data . files . snippets [ 'missing.liquid' ] ) . to . equal ( '@theme' )
74+ expect ( data . files . snippets [ 'missing-subfolder.liquid' ] ) . to . equal ( '@theme' )
7375 } )
7476
7577 it ( 'adds entries for newly referenced components from current collection' , async ( ) => {
@@ -177,12 +179,14 @@ describe('theme component map', () => {
177179 expect ( beforeData . files . assets [ 'theme-component.css' ] ) . to . equal ( '@theme' )
178180 expect ( beforeData . files . snippets [ 'other-collection-component.liquid' ] ) . to . equal ( '@other/collection' )
179181 expect ( beforeData . files . assets [ 'other-collection-component.css' ] ) . to . equal ( '@other/collection' )
182+ expect ( beforeData . files . snippets [ 'existing-subfolder.liquid' ] ) . to . equal ( '@theme' )
180183
181184 // Check that removed files are present in map
182185 expect ( beforeData . files . snippets [ 'theme-component-removed.liquid' ] ) . to . equal ( '@theme' )
183186 expect ( beforeData . files . assets [ 'theme-component-removed.css' ] ) . to . equal ( '@theme' )
184187 expect ( beforeData . files . snippets [ 'other-collection-component-removed.liquid' ] ) . to . equal ( '@other/collection' )
185188 expect ( beforeData . files . assets [ 'other-collection-component-removed.css' ] ) . to . equal ( '@other/collection' )
189+ expect ( beforeData . files . snippets [ 'removed-subfolder.liquid' ] ) . to . equal ( '@theme' )
186190
187191 await runCommand ( [ 'theme' , 'component' , 'map' , testThemePath ] )
188192
@@ -193,12 +197,14 @@ describe('theme component map', () => {
193197 expect ( data . files . assets [ 'theme-component.css' ] ) . to . equal ( '@theme' )
194198 expect ( data . files . snippets [ 'other-collection-component.liquid' ] ) . to . equal ( '@other/collection' )
195199 expect ( data . files . assets [ 'other-collection-component.css' ] ) . to . equal ( '@other/collection' )
200+ expect ( data . files . snippets [ 'existing-subfolder.liquid' ] ) . to . equal ( '@theme' )
196201
197202 // Check that removed files are no longer present in map
198203 expect ( data . files . snippets [ 'theme-component-removed.liquid' ] ) . to . be . undefined
199204 expect ( data . files . assets [ 'theme-component-removed.css' ] ) . to . be . undefined
200205 expect ( data . files . snippets [ 'other-collection-component-removed.liquid' ] ) . to . be . undefined
201206 expect ( data . files . assets [ 'other-collection-component-removed.css' ] ) . to . be . undefined
207+ expect ( data . files . snippets [ 'removed-subfolder.liquid' ] ) . to . be . undefined
202208 } )
203209
204210 it ( 'sorts the files and collections keys in the component.map.json file' , async ( ) => {
0 commit comments