@@ -97,6 +97,46 @@ describe('Product HTML Pipe Test', () => {
9797 } ) ;
9898 } ) ;
9999
100+ it ( 'renders a configurable product html from repoless site' , async ( ) => {
101+ const s3Loader = new FileS3Loader ( ) ;
102+ const state = DEFAULT_STATE ( {
103+ ...DEFAULT_CONFIG ,
104+ site : 'repoless-site' ,
105+ } , {
106+ log : console ,
107+ s3Loader,
108+ ref : 'main' ,
109+ path : '/products/product-configurable' ,
110+ partition : 'live' ,
111+ timer : {
112+ update : ( ) => { } ,
113+ } ,
114+ } ) ;
115+
116+ state . site = 'repoless-site' ;
117+ state . info = getPathInfo ( '/products/product-configurable' ) ;
118+ const resp = await productHTMLPipe (
119+ state ,
120+ new PipelineRequest (
121+ new URL ( 'https://acme.com/products/product-configurable' ) ,
122+ {
123+ headers : {
124+ 'x-byo-cdn-type' : 'fastly' ,
125+ } ,
126+ } ,
127+ ) ,
128+ ) ;
129+ assert . strictEqual ( resp . status , 200 ) ;
130+ assert . ok ( resp . body . includes ( '<h1 id="blitzmax-5000">BlitzMax 5000</h1>' ) ) ;
131+ assert . deepStrictEqual ( Object . fromEntries ( resp . headers . entries ( ) ) , {
132+ 'cache-control' : 'max-age=7200, must-revalidate' ,
133+ 'content-type' : 'text/html; charset=utf-8' ,
134+ 'last-modified' : 'Fri, 30 Apr 2021 03:47:18 GMT' ,
135+ 'surrogate-control' : 'max-age=300, stale-while-revalidate=0' ,
136+ 'surrogate-key' : 'aVjSNe6DuUvP6Qt0 _H4KMAHPxerU_zHx E2NdXMQ8Jp-cg0zr mkywV26m8w1sg6tA main--repoless-site--org mRN24kMQcclw-dMQ' ,
137+ } ) ;
138+ } ) ;
139+
100140 it ( 'renders a configurable product html with CDN cache control headers' , async ( ) => {
101141 const s3Loader = new FileS3Loader ( ) ;
102142 const state = DEFAULT_STATE ( DEFAULT_CONFIG , {
@@ -165,7 +205,7 @@ describe('Product HTML Pipe Test', () => {
165205 const dirname = path . dirname ( fileURLToPath ( import . meta. url ) ) ;
166206 const fetchMockGlobal = fetchMock . mockGlobal ( ) ;
167207 const html404 = await readFile ( path . join ( dirname , 'fixtures' , 'product' , '404.html' ) ) ;
168- fetchMockGlobal . get ( 'https://main--helix-pages --adobe.aem.live/404.html' , {
208+ fetchMockGlobal . get ( 'https://main--site --adobe.aem.live/404.html' , {
169209 body : html404 ,
170210 headers : {
171211 'cache-control' : 'max-age=7200, must-revalidate' ,
0 commit comments