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    Object {
8      "CFBundleURLTypes": Array [
9        Object {
10          "CFBundleURLSchemes": Array [
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  for (let i = 0; i < 2; i++) {
24    infoPlist = setGeneratedIosScheme(config, infoPlist);
25    expect(infoPlist).toMatchInlineSnapshot(`
26      Object {
27        "CFBundleURLTypes": Array [
28          Object {
29            "CFBundleURLSchemes": Array [
30              "exp+cello",
31            ],
32          },
33        ],
34      }
35    `);
36  }
37});
38