chore(board): remove old board tests, update seed + onboarding tests

This commit is contained in:
Jennie Robinson Faber 2026-04-14 17:31:46 +01:00
parent 7707068f36
commit f3df1945bd
7 changed files with 55 additions and 638 deletions

View file

@ -1,5 +1,13 @@
import { describe, it, expect, vi, beforeEach } from 'vitest'
const { mockBoardPostExists } = vi.hoisted(() => ({
mockBoardPostExists: vi.fn()
}))
vi.mock('../../../server/models/boardPost.js', () => ({
default: { exists: mockBoardPostExists }
}))
vi.mock('../../../server/utils/auth.js', () => ({
requireAuth: vi.fn()
}))
@ -45,6 +53,7 @@ describe('POST /api/onboarding/track', () => {
})
Member.findByIdAndUpdate.mockResolvedValue({})
Member.findOneAndUpdate.mockResolvedValue(null) // no graduation by default
mockBoardPostExists.mockResolvedValue({ _id: 'post-1' })
})
// 2.1: Sets eventPageVisited to true