Skip to content

Commit 2b5f70b

Browse files
committed
add capabilityList
1 parent 0164e06 commit 2b5f70b

File tree

4 files changed

+695
-658
lines changed

4 files changed

+695
-658
lines changed

packages/eas-cli/src/credentials/ios/appstore/__tests__/bundleIdCapabilities-test.ts

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
import { BundleIdCapability } from '@expo/apple-utils';
22

3-
import {
4-
CapabilityMapping,
5-
assertValidOptions,
6-
syncCapabilitiesForEntitlementsAsync,
7-
} from '../bundleIdCapabilities';
3+
import { assertValidOptions, syncCapabilitiesForEntitlementsAsync } from '../bundleIdCapabilities';
4+
import { CapabilityMapping } from '../capabilityList';
85

96
const broadcastNotificationOption = {
107
usesBroadcastPushNotifications: false,
@@ -291,6 +288,39 @@ describe(syncCapabilitiesForEntitlementsAsync, () => {
291288
{ capabilityType: 'ACCESS_WIFI_INFORMATION', option: 'OFF' },
292289
]);
293290
});
291+
292+
it('given a bundleId with a capability that is enabled, and the entitlement is set to true, the capability is skipped', async () => {
293+
const ctx = { providerId: 123195, teamId: 'MyteamId' };
294+
const remote = {
295+
id: 'UFJ54VZ75A_ACCESS_WIFI_INFORMATION',
296+
attributes: {
297+
ownerType: 'BUNDLE',
298+
settings: null,
299+
editable: true,
300+
inputs: null,
301+
enabled: true,
302+
responseId: '31746b7d-4728-49f5-a8f9-a81c0cecabb1',
303+
},
304+
};
305+
306+
const capability = new BundleIdCapability(ctx, remote.id, remote.attributes as any);
307+
const bundleId = {
308+
getBundleIdCapabilitiesAsync: jest.fn(() => [capability]),
309+
updateBundleIdCapabilityAsync: jest.fn(),
310+
id: 'UFJ54VZ75A',
311+
} as any;
312+
const { enabled, disabled } = await syncCapabilitiesForEntitlementsAsync(
313+
bundleId,
314+
{
315+
'com.apple.developer.networking.wifi-info': true,
316+
},
317+
broadcastNotificationOption
318+
);
319+
320+
expect(enabled).toStrictEqual([]);
321+
expect(disabled).toStrictEqual([]);
322+
expect(bundleId.updateBundleIdCapabilityAsync).not.toHaveBeenCalled();
323+
});
294324
});
295325

296326
it('enables all capabilities', async () => {

0 commit comments

Comments
 (0)