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