Added vitest and broke up components
This commit is contained in:
14
src/token.test.ts
Normal file
14
src/token.test.ts
Normal file
@ -0,0 +1,14 @@
|
||||
// @vitest-environment jsdom
|
||||
|
||||
import { assert, expect, test } from 'vitest'
|
||||
import {displayToken} from './token'
|
||||
|
||||
test('a 6 digit token is displayed', () => {
|
||||
const token = displayToken('ABCDEFGHIJKLMNOP')
|
||||
expect(token.length).toBe(6)
|
||||
})
|
||||
|
||||
test('displayed totp token is numeric only', () => {
|
||||
const token = displayToken('ABCDEFGHIJKLMNOP')
|
||||
expect(isNaN(+token)).toBeFalsy()
|
||||
})
|
Reference in New Issue
Block a user