Skip to content

Commit

Permalink
test(apple): apple template v3 (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
aahna-ashina committed Sep 12, 2022
1 parent 848304e commit 0943c3d
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions server/utils/Passes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,26 @@ test('generatePass - Apple v2', () => {
expect(filePath).toContain('passport_0x394b00B5De4E6f30292aCaC37f810Dd0672E211E.pkpass')
expect(fs.existsSync(filePath)).toBe(true)
})

test('generatePass - Apple v3', () => {
const platform: Platform = Platform.Apple
const templateVersion: number = 2
const passportID: string = Math.floor(1 + (Math.random() * 840)).toString() // [1, 840]
const issueDateTimestamp: number = 1662541136 // September 7, 2022 8:58:56 AM
const address: string = '0x394b00B5De4E6f30292aCaC37f810Dd0672E211E'
const ensName: string = 'vitalik.eth'
const latestUpdateTitle: string = 'N3GOV-15: Set Nation3\’s North Star metrics'
const latestUpdateContent: string = 'A North Star metric is paramount since it aligns everyone in the nation towards a particular, measurable goal.'
const filePath: string = Passes.generatePass(
platform,
templateVersion,
passportID,
issueDateTimestamp,
address,
ensName,
latestUpdateTitle,
latestUpdateContent
)
expect(filePath).toContain('passport_0x394b00B5De4E6f30292aCaC37f810Dd0672E211E.pkpass')
expect(fs.existsSync(filePath)).toBe(true)
})

0 comments on commit 0943c3d

Please sign in to comment.