@@ -213,7 +213,7 @@ describe('util/manifest', () => {
213213 describe ( 'getManifestId' , ( ) => {
214214 const id = 'basic-manifest@web-ext-test-suite' ;
215215
216- [ 'applications' , 'browser_specific_settings' ] . forEach ( ( key ) => {
216+ [ 'applications' , 'browser_specific_settings' ] . forEach ( ( key : string ) => {
217217
218218 describe ( `with ${ key } ` , ( ) => {
219219
@@ -238,6 +238,35 @@ describe('util/manifest', () => {
238238
239239 } ) ;
240240
241+ describe ( 'with both applications and browser_specific_settings' , ( ) => {
242+ const bssId = 'id@from-bss-prop' ;
243+ const appId = 'id@from-app-prop' ;
244+
245+ it ( 'does prefer bss if it includes a gecko object' , ( ) => {
246+ assert . equal ( getManifestId ( {
247+ ...manifestWithoutApps ,
248+ browser_specific_settings : { gecko : { id : bssId } } ,
249+ applications : { gecko : { id : appId } } ,
250+ } ) , bssId ) ;
251+
252+ // This test that we are matching what Firefox does in this scenario.
253+ assert . equal ( getManifestId ( {
254+ ...manifestWithoutApps ,
255+ browser_specific_settings : { gecko : { } } ,
256+ applications : { gecko : { id : appId } } ,
257+ } ) , undefined ) ;
258+ } ) ;
259+
260+ it ( 'does fallback to applications if bss.gecko is undefined' , ( ) => {
261+ assert . equal ( getManifestId ( {
262+ ...manifestWithoutApps ,
263+ browser_specific_settings : { } ,
264+ applications : { gecko : { id : appId } } ,
265+ } ) , appId ) ;
266+ } ) ;
267+
268+ } ) ;
269+
241270 describe ( 'without applications and browser_specific_settings' , ( ) => {
242271
243272 it ( 'returns undefined when ID is not specified' , ( ) => {
0 commit comments