-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added creation date to the AppleDevice formatting function used to display details in cli See: https://linear.app/expo/issue/ENG-10334/show-creation-time-of-device-record-in-ad-hoc-device-selection-prompt
- Loading branch information
1 parent
606ce9a
commit 41c039c
Showing
2 changed files
with
26 additions
and
1 deletion.
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
25 changes: 25 additions & 0 deletions
25
packages/eas-cli/src/credentials/ios/actions/__tests__/DeviceUtils-test.ts
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,25 @@ | ||
import { v4 as uuidv4 } from 'uuid'; | ||
|
||
import { AppleDeviceClass, AppleDeviceFragment } from '../../../../graphql/generated'; | ||
import { formatDeviceLabel } from '../DeviceUtils'; | ||
|
||
describe(formatDeviceLabel, () => { | ||
it('returns createdAt clause', async () => { | ||
const currentDate = new Date(); | ||
const appleDevice = { | ||
__typename: 'AppleDevice', | ||
id: uuidv4(), | ||
identifier: 'test-apple-device-id', | ||
name: 'test-apple-device-name', | ||
model: '15', | ||
deviceClass: AppleDeviceClass.Iphone, | ||
createdAt: currentDate.toISOString(), | ||
} as AppleDeviceFragment; | ||
|
||
const result = formatDeviceLabel(appleDevice); | ||
|
||
expect(result).toEqual( | ||
`test-apple-device-id (iPhone 15) (test-apple-device-name) (created at: ${currentDate.toISOString()})` | ||
); | ||
}); | ||
}); |