1import { setGeneratedIosScheme } from '../withGeneratedIosScheme'; 2 3it(`adds a scheme generated from slug`, () => { 4 const config = { slug: 'cello' }; 5 const infoPlist = {}; 6 expect(setGeneratedIosScheme(config, infoPlist)).toMatchInlineSnapshot(` 7 { 8 "CFBundleURLTypes": [ 9 { 10 "CFBundleURLSchemes": [ 11 "exp+cello", 12 ], 13 }, 14 ], 15 } 16 `); 17}); 18 19it(`prevents adding a duplicate scheme`, () => { 20 let infoPlist = {}; 21 const config = { slug: 'cello' }; 22 23 infoPlist = setGeneratedIosScheme(config, infoPlist); 24 expect(infoPlist).toMatchInlineSnapshot(` 25 { 26 "CFBundleURLTypes": [ 27 { 28 "CFBundleURLSchemes": [ 29 "exp+cello", 30 ], 31 }, 32 ], 33 } 34 `); 35 36 // ensure idempotent 37 const infoPlist2 = setGeneratedIosScheme(config, infoPlist); 38 expect(infoPlist2).toEqual(infoPlist); 39}); 40