@@ -213,7 +213,7 @@ describe('util/manifest', () => {
213
213
describe ( 'getManifestId' , ( ) => {
214
214
const id = 'basic-manifest@web-ext-test-suite' ;
215
215
216
- [ 'applications' , 'browser_specific_settings' ] . forEach ( ( key ) => {
216
+ [ 'applications' , 'browser_specific_settings' ] . forEach ( ( key : string ) => {
217
217
218
218
describe ( `with ${ key } ` , ( ) => {
219
219
@@ -238,6 +238,35 @@ describe('util/manifest', () => {
238
238
239
239
} ) ;
240
240
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
+
241
270
describe ( 'without applications and browser_specific_settings' , ( ) => {
242
271
243
272
it ( 'returns undefined when ID is not specified' , ( ) => {
0 commit comments