@@ -206,15 +206,8 @@ describe('getUIExtensionPayload', () => {
206206 } )
207207 } )
208208
209- test ( 'maps main and should_render from build_manifest ' , async ( ) => {
209+ test ( 'maps main and should_render paths from manifest.json ' , async ( ) => {
210210 await inTemporaryDirectory ( async ( tmpDir ) => {
211- const buildManifest = {
212- assets : {
213- main : { module : './src/ExtensionPointA.js' , filepath : 'test-ui-extension.js' } ,
214- should_render : { module : './src/ShouldRender.js' , filepath : 'test-ui-extension-conditions.js' } ,
215- } ,
216- }
217-
218211 const uiExtension = await testUIExtension ( {
219212 directory : tmpDir ,
220213 configuration : {
@@ -224,18 +217,12 @@ describe('getUIExtensionPayload', () => {
224217 {
225218 target : 'CUSTOM_EXTENSION_POINT' ,
226219 module : './src/ExtensionPointA.js' ,
227- build_manifest : buildManifest ,
228220 } ,
229221 ] ,
230222 } ,
231223 devUUID : 'devUUID' ,
232224 } )
233225
234- // Create source files so lastUpdated resolves
235- await mkdir ( joinPath ( tmpDir , 'src' ) )
236- await writeFile ( joinPath ( tmpDir , 'src' , 'ExtensionPointA.js' ) , '// main' )
237- await writeFile ( joinPath ( tmpDir , 'src' , 'ShouldRender.js' ) , '// should render' )
238-
239226 await setupBuildOutput (
240227 uiExtension ,
241228 tmpDir ,
@@ -268,6 +255,60 @@ describe('getUIExtensionPayload', () => {
268255 } )
269256 } )
270257
258+ test ( 'maps main and should_render with bundleFolder prefix from manifest.json' , async ( ) => {
259+ await inTemporaryDirectory ( async ( tmpDir ) => {
260+ const uiExtension = await testUIExtension ( {
261+ directory : tmpDir ,
262+ configuration : {
263+ name : 'test-ui-extension' ,
264+ type : 'ui_extension' ,
265+ extension_points : [
266+ {
267+ target : 'CUSTOM_EXTENSION_POINT' ,
268+ module : './src/ExtensionPointA.js' ,
269+ } ,
270+ ] ,
271+ } ,
272+ devUUID : 'devUUID' ,
273+ } )
274+
275+ await setupBuildOutput (
276+ uiExtension ,
277+ tmpDir ,
278+ {
279+ CUSTOM_EXTENSION_POINT : {
280+ main : 'dist/test-ui-extension.js' ,
281+ should_render : 'dist/test-ui-extension-conditions.js' ,
282+ } ,
283+ } ,
284+ { } ,
285+ )
286+
287+ const got = await getUIExtensionPayload ( uiExtension , tmpDir , {
288+ ...createMockOptions ( tmpDir , [ uiExtension ] ) ,
289+ currentDevelopmentPayload : { hidden : true , status : 'success' } ,
290+ } )
291+
292+ expect ( got . extensionPoints ) . toMatchObject ( [
293+ {
294+ target : 'CUSTOM_EXTENSION_POINT' ,
295+ assets : {
296+ main : {
297+ name : 'main' ,
298+ url : 'http://tunnel-url.com/extensions/devUUID/assets/dist/test-ui-extension.js' ,
299+ lastUpdated : expect . any ( Number ) ,
300+ } ,
301+ should_render : {
302+ name : 'should_render' ,
303+ url : 'http://tunnel-url.com/extensions/devUUID/assets/dist/test-ui-extension-conditions.js' ,
304+ lastUpdated : expect . any ( Number ) ,
305+ } ,
306+ } ,
307+ } ,
308+ ] )
309+ } )
310+ } )
311+
271312 test ( 'maps intents from manifest.json to asset payloads' , async ( ) => {
272313 await inTemporaryDirectory ( async ( tmpDir ) => {
273314 const uiExtension = await testUIExtension ( {
0 commit comments