refactor testing
Some checks failed
ci/woodpecker/pr/pr Pipeline failed

This commit is contained in:
Madison Grubb
2026-02-17 11:05:57 -05:00
parent b0e8dd7ad9
commit 1a566e2d80
57 changed files with 1127 additions and 1760 deletions

View File

@@ -2,7 +2,7 @@ import { describe, it, expect } from 'vitest'
import { hashPassword, verifyPassword } from '../../server/utils/password.js'
describe('password', () => {
it('hashes and verifies', () => {
it('hashes and verifies password', () => {
const password = 'secret123'
const stored = hashPassword(password)
expect(stored).toContain(':')
@@ -14,8 +14,10 @@ describe('password', () => {
expect(verifyPassword('wrong', stored)).toBe(false)
})
it('rejects invalid stored format', () => {
expect(verifyPassword('a', '')).toBe(false)
expect(verifyPassword('a', 'nocolon')).toBe(false)
it.each([
['a', ''],
['a', 'nocolon'],
])('rejects invalid stored format: password=%s, stored=%s', (password, stored) => {
expect(verifyPassword(password, stored)).toBe(false)
})
})