Skip to content

Commit

Permalink
added testng for tick date formatting change
Browse files Browse the repository at this point in the history
  • Loading branch information
wkencel committed Dec 22, 2024
1 parent 1c12f3c commit 1bf1524
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/__tests__/ticks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ describe('ticks API', () => {
name: 'Updated Route One',
climbId: 'new climb id',
userId: userUuid,
dateClimbed: '2022-11-10',
dateClimbed: new Date('2022-11-10T12:00:00Z'),
grade: 'new grade',
source: 'OB'
}
Expand All @@ -218,5 +218,21 @@ describe('ticks API', () => {
expect(updateResponse.statusCode).toBe(200)
expect(updateResponse.body.data.tick.name).toBe('Updated Route One')
})
it('verifies date formats correctly', async () => {
const validDateTick = {
...tickOne,
dateClimbed: new Date('2022-11-10T15:30:00Z').getTime()
}
const validResponse = await queryAPI({
query: createQuery,
variables: { input: validDateTick },
userUuid,
roles: ['user_admin'],
app
})
expect(validResponse.statusCode).toBe(200)
expect(validResponse.body.data.tick.dateClimbed)
.toBe(new Date('2022-11-10T15:30:00Z').getTime())
})
})
})

0 comments on commit 1bf1524

Please sign in to comment.