This repository has been archived by the owner on Jan 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 477
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[cli] better non interactive support for creds (#1881)
* [cli] better non interactive support for creds * [cli] credential tests * pass in non interactive sites to constructors
- Loading branch information
Showing
14 changed files
with
683 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
const today = new Date(); | ||
const tomorrow = new Date(today.getTime() + 24 * 60 * 60 * 1000); | ||
export const testProvisioningProfile = { | ||
provisioningProfileId: 'test-id', | ||
}; | ||
export const testProvisioningProfiles = [testProvisioningProfile]; | ||
export const testProvisioningProfileFromApple = { | ||
name: 'test-name', | ||
status: 'Active', | ||
expires: tomorrow, | ||
distributionMethod: 'test', | ||
certificates: [], | ||
provisioningProfileId: testProvisioningProfile.provisioningProfileId, | ||
}; | ||
export const testProvisioningProfilesFromApple = [testProvisioningProfileFromApple]; | ||
|
||
export const testDistCert = { | ||
id: 1, | ||
type: 'dist-cert', | ||
certP12: 'test-p12', | ||
certPassword: 'test-password', | ||
distCertSerialNumber: 'test-serial', | ||
teamId: 'test-team-id', | ||
}; | ||
export const testDistCerts = [testDistCert]; | ||
export const testDistCertFromApple = { | ||
id: 'test-id', | ||
status: 'Active', | ||
created: today.getTime(), | ||
expires: tomorrow.getTime(), | ||
serialNumber: testDistCert.distCertSerialNumber, | ||
}; | ||
export const testDistCertsFromApple = [testDistCertFromApple]; | ||
|
||
export const testPushKey = { | ||
id: 1, | ||
type: 'push-key', | ||
apnsKeyP8: 'test-p8', | ||
apnsKeyId: 'test-key-id', | ||
teamId: 'test-team-id', | ||
}; | ||
export const testPushKeys = [testPushKey]; | ||
export const testPushKeyFromApple = { | ||
id: testPushKey.apnsKeyId, | ||
name: 'test-name', | ||
}; | ||
export const testPushKeysFromApple = [testPushKeyFromApple]; | ||
|
||
export const testAppCredentials = [{ experienceName: 'testApp', bundleIdentifier: 'test.com.app' }]; | ||
export function getCtxMock() { | ||
return { | ||
ios: { | ||
getDistCert: jest.fn(), | ||
createDistCert: jest.fn(() => testDistCert), | ||
useDistCert: jest.fn(), | ||
getPushKey: jest.fn(), | ||
createPushKey: jest.fn(() => testPushKey), | ||
usePushKey: jest.fn(), | ||
updateProvisioningProfile: jest.fn(), | ||
getAppCredentials: jest.fn(() => testAppCredentials), | ||
getProvisioningProfile: jest.fn(), | ||
credentials: { | ||
userCredentials: [...testDistCerts, ...testPushKeys], | ||
appCredentials: testAppCredentials, | ||
}, | ||
}, | ||
appleCtx: { | ||
appleId: 'test-id', | ||
appleIdPassword: 'test-password', | ||
team: { id: 'test-team-id' }, | ||
fastlaneSession: 'test-fastlane-session', | ||
}, | ||
ensureAppleCtx: jest.fn(), | ||
user: jest.fn(), | ||
hasAppleCtx: jest.fn(() => true), | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.