/** A locked staff account answers like a wrong password with 2FA off too (lockedAnswerSuite.ts). */ import { describe, expect, test, vi } from 'vitest' import { lockedAnswerSite, PASSWORD } from './lockedAnswerSuite.js' vi.mock('server-only', () => ({})) const { gqlLogin, lock, restLogin } = lockedAnswerSite({ twoFactor: false }) describe('accounts.lockedAnswer with twoFactor: false', () => { test('REST and GraphQL answer the locked owner like an invented address', async () => { await lock('users', 'owner@example.com') expect(await restLogin('users', 'owner@example.com', PASSWORD)).toEqual(await restLogin('users', 'nobody@example.com', 'x-wrong-password-1')) expect(await gqlLogin('loginUser', 'owner@example.com', PASSWORD)).toEqual(await gqlLogin('loginUser', 'nobody@example.com', 'x-wrong-password-1')) }) })