gradido/backend/src/graphql/resolver/TransactionLinkResolver.test.ts
2022-03-09 15:43:13 +01:00

15 lines
459 B
TypeScript

import { transactionLinkCode } from './TransactionLinkResolver'
describe('transactionLinkCode', () => {
const date = new Date()
it('returns a string of length 24', () => {
expect(transactionLinkCode(date)).toHaveLength(24)
})
it('returns a string that ends with the hex value of date', () => {
const regexp = new RegExp(date.getTime().toString(16) + '$')
expect(transactionLinkCode(date)).toEqual(expect.stringMatching(regexp))
})
})