1import { setICloudEntitlements } from '../withDocumentPickerIOS';
2
3describe(setICloudEntitlements, () => {
4  it(`skips setting the iCloud entitlements if the flag isn't enabled`, () => {
5    expect(
6      setICloudEntitlements({ ios: {} }, { iCloudContainerEnvironment: 'Production' }, {})
7    ).toStrictEqual({});
8  });
9  it(`sets the iCloud entitlements`, () => {
10    expect(
11      setICloudEntitlements(
12        { ios: { usesIcloudStorage: true, bundleIdentifier: 'com.bacon.foobar' } },
13        { iCloudContainerEnvironment: 'Production' },
14        {}
15      )
16    ).toStrictEqual({
17      'com.apple.developer.icloud-container-environment': 'Production',
18      'com.apple.developer.icloud-container-identifiers': ['iCloud.com.bacon.foobar'],
19      'com.apple.developer.icloud-services': ['CloudDocuments'],
20      'com.apple.developer.ubiquity-container-identifiers': ['iCloud.com.bacon.foobar'],
21      'com.apple.developer.ubiquity-kvstore-identifier': '$(TeamIdentifierPrefix)com.bacon.foobar',
22    });
23  });
24});
25