@@ -7,9 +7,9 @@ vi.mock('@shopify/cli-kit/node/fs')
77
88describe ( 'hosted_app_home' , ( ) => {
99 describe ( 'transform' , ( ) => {
10- test ( 'should return the transformed object with static_root' , ( ) => {
10+ test ( 'should return the transformed object with static_root (local admin subsection to flat remote) ' , ( ) => {
1111 const object = {
12- static_root : 'public' ,
12+ admin : { static_root : 'public' } ,
1313 }
1414 const appConfigSpec = spec
1515
@@ -20,7 +20,7 @@ describe('hosted_app_home', () => {
2020 } )
2121 } )
2222
23- test ( 'should return empty object when static_root is not provided' , ( ) => {
23+ test ( 'should return empty object when admin. static_root is not provided' , ( ) => {
2424 const object = { }
2525 const appConfigSpec = spec
2626
@@ -31,7 +31,7 @@ describe('hosted_app_home', () => {
3131 } )
3232
3333 describe ( 'reverseTransform' , ( ) => {
34- test ( 'should return the reversed transformed object with static_root ' , ( ) => {
34+ test ( 'should return the reversed transformed object (flat remote to local admin subsection) ' , ( ) => {
3535 const object = {
3636 static_root : 'public' ,
3737 }
@@ -40,7 +40,7 @@ describe('hosted_app_home', () => {
4040 const result = appConfigSpec . transformRemoteToLocal ! ( object )
4141
4242 expect ( result ) . toMatchObject ( {
43- static_root : 'public' ,
43+ admin : { static_root : 'public' } ,
4444 } )
4545 } )
4646
@@ -57,7 +57,7 @@ describe('hosted_app_home', () => {
5757 describe ( 'copyStaticAssets' , ( ) => {
5858 test ( 'should copy static assets from source to output directory' , async ( ) => {
5959 vi . mocked ( copyDirectoryContents ) . mockResolvedValue ( undefined )
60- const config = { static_root : 'public' }
60+ const config = { admin : { static_root : 'public' } }
6161 const directory = '/app/root'
6262 const outputPath = '/output/dist/bundle.js'
6363
@@ -66,7 +66,7 @@ describe('hosted_app_home', () => {
6666 expect ( copyDirectoryContents ) . toHaveBeenCalledWith ( '/app/root/public' , '/output/dist' )
6767 } )
6868
69- test ( 'should not copy assets when static_root is not provided' , async ( ) => {
69+ test ( 'should not copy assets when admin. static_root is not provided' , async ( ) => {
7070 const config = { }
7171 const directory = '/app/root'
7272 const outputPath = '/output/dist/bundle.js'
@@ -78,7 +78,7 @@ describe('hosted_app_home', () => {
7878
7979 test ( 'should throw error when copy fails' , async ( ) => {
8080 vi . mocked ( copyDirectoryContents ) . mockRejectedValue ( new Error ( 'Permission denied' ) )
81- const config = { static_root : 'public' }
81+ const config = { admin : { static_root : 'public' } }
8282 const directory = '/app/root'
8383 const outputPath = '/output/dist/bundle.js'
8484
0 commit comments