mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-20 11:06:06 +00:00
test(db): run the trips and vacay suites on the real database module
They reset through resetDatabase and seed through the ORM factories on the booted app's ORM instead of the SQLite snapshot mock, so they run in the Postgres lane as well.
This commit is contained in:
@@ -3,14 +3,14 @@
|
||||
* Covers VACAY-001 to VACAY-025.
|
||||
*/
|
||||
import { buildApp } from '../../src/bootstrap';
|
||||
import { db as testDb } from '../../src/db/database';
|
||||
import { VacayHolidayCalendars } from '../../src/db/entities/VacayHolidayCalendars.entity';
|
||||
import { VacayService } from '../../src/nest/vacay/vacay.service';
|
||||
import { authCookie } from '../helpers/auth';
|
||||
import { createUser } from '../helpers/factories';
|
||||
import type { FactoryOrm } from '../helpers/factories/context';
|
||||
import { findRows } from '../helpers/factories/rows';
|
||||
import { resetTestDb, resetRateLimits } from '../helpers/test-db';
|
||||
import { makeUser } from '../helpers/factories/users';
|
||||
import { resetDatabase } from '../helpers/reset-database';
|
||||
import { resetRateLimits } from '../helpers/test-db';
|
||||
import { MikroORM } from '@mikro-orm/core';
|
||||
import type { INestApplication } from '@nestjs/common';
|
||||
|
||||
@@ -18,11 +18,6 @@ import type { Application } from 'express';
|
||||
import request from 'supertest';
|
||||
import { describe, it, expect, vi, beforeAll, beforeEach, afterAll } from 'vitest';
|
||||
|
||||
vi.mock('../../src/db/database', async () => {
|
||||
const { createSnapshotTestDb, buildDbMock } = await import('../helpers/db-mock');
|
||||
return buildDbMock(createSnapshotTestDb());
|
||||
});
|
||||
|
||||
// Prevent real HTTP calls (holiday API etc.)
|
||||
vi.stubGlobal(
|
||||
'fetch',
|
||||
@@ -68,19 +63,18 @@ async function latestCalendarId(): Promise<number | undefined> {
|
||||
}
|
||||
|
||||
beforeEach(async () => {
|
||||
resetTestDb(testDb);
|
||||
await resetDatabase(orm);
|
||||
await resetRateLimits(nestApp);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await nestApp.close();
|
||||
testDb.close();
|
||||
vi.unstubAllGlobals();
|
||||
});
|
||||
|
||||
describe('Vacay plan', () => {
|
||||
it('VACAY-001 — GET /api/addons/vacay/plan auto-creates plan on first access', async () => {
|
||||
const { user } = createUser(testDb);
|
||||
const { user } = await makeUser(orm);
|
||||
|
||||
const res = await request(app).get('/api/addons/vacay/plan').set('Cookie', authCookie(user.id));
|
||||
expect(res.status).toBe(200);
|
||||
@@ -89,7 +83,7 @@ describe('Vacay plan', () => {
|
||||
});
|
||||
|
||||
it('VACAY-001 — second GET returns same plan (no duplicate creation)', async () => {
|
||||
const { user } = createUser(testDb);
|
||||
const { user } = await makeUser(orm);
|
||||
|
||||
await request(app).get('/api/addons/vacay/plan').set('Cookie', authCookie(user.id));
|
||||
const res = await request(app).get('/api/addons/vacay/plan').set('Cookie', authCookie(user.id));
|
||||
@@ -98,7 +92,7 @@ describe('Vacay plan', () => {
|
||||
});
|
||||
|
||||
it('VACAY-002 — PUT /api/addons/vacay/plan updates plan settings', async () => {
|
||||
const { user } = createUser(testDb);
|
||||
const { user } = await makeUser(orm);
|
||||
|
||||
// Ensure plan exists
|
||||
await request(app).get('/api/addons/vacay/plan').set('Cookie', authCookie(user.id));
|
||||
@@ -113,7 +107,7 @@ describe('Vacay plan', () => {
|
||||
|
||||
describe('Vacay years', () => {
|
||||
it('VACAY-007 — POST /api/addons/vacay/years adds a year to the plan', async () => {
|
||||
const { user } = createUser(testDb);
|
||||
const { user } = await makeUser(orm);
|
||||
await request(app).get('/api/addons/vacay/plan').set('Cookie', authCookie(user.id));
|
||||
|
||||
const res = await request(app)
|
||||
@@ -125,7 +119,7 @@ describe('Vacay years', () => {
|
||||
});
|
||||
|
||||
it('VACAY-025 — GET /api/addons/vacay/years lists years in plan', async () => {
|
||||
const { user } = createUser(testDb);
|
||||
const { user } = await makeUser(orm);
|
||||
await request(app).get('/api/addons/vacay/plan').set('Cookie', authCookie(user.id));
|
||||
await request(app).post('/api/addons/vacay/years').set('Cookie', authCookie(user.id)).send({ year: 2025 });
|
||||
|
||||
@@ -136,7 +130,7 @@ describe('Vacay years', () => {
|
||||
});
|
||||
|
||||
it('VACAY-008 — DELETE /api/addons/vacay/years/:year removes year', async () => {
|
||||
const { user } = createUser(testDb);
|
||||
const { user } = await makeUser(orm);
|
||||
await request(app).get('/api/addons/vacay/plan').set('Cookie', authCookie(user.id));
|
||||
await request(app).post('/api/addons/vacay/years').set('Cookie', authCookie(user.id)).send({ year: 2026 });
|
||||
|
||||
@@ -146,7 +140,7 @@ describe('Vacay years', () => {
|
||||
});
|
||||
|
||||
it('VACAY-011 — PUT /api/addons/vacay/stats/:year updates allowance', async () => {
|
||||
const { user } = createUser(testDb);
|
||||
const { user } = await makeUser(orm);
|
||||
await request(app).get('/api/addons/vacay/plan').set('Cookie', authCookie(user.id));
|
||||
await request(app).post('/api/addons/vacay/years').set('Cookie', authCookie(user.id)).send({ year: 2025 });
|
||||
|
||||
@@ -160,7 +154,7 @@ describe('Vacay years', () => {
|
||||
|
||||
describe('Vacay entries', () => {
|
||||
it('VACAY-003 — POST /api/addons/vacay/entries/toggle marks a day as vacation', async () => {
|
||||
const { user } = createUser(testDb);
|
||||
const { user } = await makeUser(orm);
|
||||
await request(app).get('/api/addons/vacay/plan').set('Cookie', authCookie(user.id));
|
||||
await request(app).post('/api/addons/vacay/years').set('Cookie', authCookie(user.id)).send({ year: 2025 });
|
||||
|
||||
@@ -172,7 +166,7 @@ describe('Vacay entries', () => {
|
||||
});
|
||||
|
||||
it('VACAY-004 — POST /api/addons/vacay/entries/toggle on a weekend is rejected when block_weekends is on', async () => {
|
||||
const { user } = createUser(testDb);
|
||||
const { user } = await makeUser(orm);
|
||||
await request(app).get('/api/addons/vacay/plan').set('Cookie', authCookie(user.id));
|
||||
await request(app).post('/api/addons/vacay/years').set('Cookie', authCookie(user.id)).send({ year: 2025 });
|
||||
|
||||
@@ -186,7 +180,7 @@ describe('Vacay entries', () => {
|
||||
});
|
||||
|
||||
it('VACAY-006 — GET /api/addons/vacay/entries/:year returns vacation entries', async () => {
|
||||
const { user } = createUser(testDb);
|
||||
const { user } = await makeUser(orm);
|
||||
await request(app).get('/api/addons/vacay/plan').set('Cookie', authCookie(user.id));
|
||||
await request(app).post('/api/addons/vacay/years').set('Cookie', authCookie(user.id)).send({ year: 2025 });
|
||||
|
||||
@@ -196,7 +190,7 @@ describe('Vacay entries', () => {
|
||||
});
|
||||
|
||||
it('VACAY-009 — GET /api/addons/vacay/stats/:year returns stats for year', async () => {
|
||||
const { user } = createUser(testDb);
|
||||
const { user } = await makeUser(orm);
|
||||
await request(app).get('/api/addons/vacay/plan').set('Cookie', authCookie(user.id));
|
||||
await request(app).post('/api/addons/vacay/years').set('Cookie', authCookie(user.id)).send({ year: 2025 });
|
||||
|
||||
@@ -208,7 +202,7 @@ describe('Vacay entries', () => {
|
||||
|
||||
describe('Vacay color', () => {
|
||||
it('VACAY-024 — PUT /api/addons/vacay/color sets user color in plan', async () => {
|
||||
const { user } = createUser(testDb);
|
||||
const { user } = await makeUser(orm);
|
||||
await request(app).get('/api/addons/vacay/plan').set('Cookie', authCookie(user.id));
|
||||
|
||||
const res = await request(app)
|
||||
@@ -221,7 +215,7 @@ describe('Vacay color', () => {
|
||||
|
||||
describe('Vacay invite flow', () => {
|
||||
it('VACAY-022 — cannot invite yourself', async () => {
|
||||
const { user } = createUser(testDb);
|
||||
const { user } = await makeUser(orm);
|
||||
await request(app).get('/api/addons/vacay/plan').set('Cookie', authCookie(user.id));
|
||||
|
||||
const res = await request(app)
|
||||
@@ -232,8 +226,8 @@ describe('Vacay invite flow', () => {
|
||||
});
|
||||
|
||||
it('VACAY-016 — send invite to another user', async () => {
|
||||
const { user: owner } = createUser(testDb);
|
||||
const { user: invitee } = createUser(testDb);
|
||||
const { user: owner } = await makeUser(orm);
|
||||
const { user: invitee } = await makeUser(orm);
|
||||
await request(app).get('/api/addons/vacay/plan').set('Cookie', authCookie(owner.id));
|
||||
|
||||
const res = await request(app)
|
||||
@@ -245,7 +239,7 @@ describe('Vacay invite flow', () => {
|
||||
});
|
||||
|
||||
it('VACAY-023 — GET /api/addons/vacay/available-users returns users who can be invited', async () => {
|
||||
const { user } = createUser(testDb);
|
||||
const { user } = await makeUser(orm);
|
||||
await request(app).get('/api/addons/vacay/plan').set('Cookie', authCookie(user.id));
|
||||
|
||||
const res = await request(app).get('/api/addons/vacay/available-users').set('Cookie', authCookie(user.id));
|
||||
@@ -256,7 +250,7 @@ describe('Vacay invite flow', () => {
|
||||
|
||||
describe('Vacay holidays', () => {
|
||||
it('VACAY-014 — GET /api/addons/vacay/holidays/countries returns available countries', async () => {
|
||||
const { user } = createUser(testDb);
|
||||
const { user } = await makeUser(orm);
|
||||
|
||||
const res = await request(app).get('/api/addons/vacay/holidays/countries').set('Cookie', authCookie(user.id));
|
||||
expect(res.status).toBe(200);
|
||||
@@ -264,7 +258,7 @@ describe('Vacay holidays', () => {
|
||||
});
|
||||
|
||||
it('VACAY-012 — POST /api/addons/vacay/plan/holiday-calendars adds a holiday calendar', async () => {
|
||||
const { user } = createUser(testDb);
|
||||
const { user } = await makeUser(orm);
|
||||
await request(app).get('/api/addons/vacay/plan').set('Cookie', authCookie(user.id));
|
||||
|
||||
const res = await request(app)
|
||||
@@ -277,7 +271,7 @@ describe('Vacay holidays', () => {
|
||||
|
||||
describe('Vacay dissolve plan', () => {
|
||||
it('VACAY-020 — POST /api/addons/vacay/dissolve removes user from plan', async () => {
|
||||
const { user } = createUser(testDb);
|
||||
const { user } = await makeUser(orm);
|
||||
await request(app).get('/api/addons/vacay/plan').set('Cookie', authCookie(user.id));
|
||||
|
||||
const res = await request(app).post('/api/addons/vacay/dissolve').set('Cookie', authCookie(user.id));
|
||||
@@ -287,7 +281,7 @@ describe('Vacay dissolve plan', () => {
|
||||
|
||||
describe('Vacay holiday calendar CRUD', () => {
|
||||
it('VACAY-026 — PUT /plan/holiday-calendars/:id updates an existing calendar', async () => {
|
||||
const { user } = createUser(testDb);
|
||||
const { user } = await makeUser(orm);
|
||||
await request(app).get('/api/addons/vacay/plan').set('Cookie', authCookie(user.id));
|
||||
|
||||
// Create a calendar first
|
||||
@@ -306,7 +300,7 @@ describe('Vacay holiday calendar CRUD', () => {
|
||||
});
|
||||
|
||||
it('VACAY-027 — DELETE /plan/holiday-calendars/:id removes the calendar', async () => {
|
||||
const { user } = createUser(testDb);
|
||||
const { user } = await makeUser(orm);
|
||||
await request(app).get('/api/addons/vacay/plan').set('Cookie', authCookie(user.id));
|
||||
|
||||
const createRes = await request(app)
|
||||
@@ -324,7 +318,7 @@ describe('Vacay holiday calendar CRUD', () => {
|
||||
});
|
||||
|
||||
it('VACAY-027b — DELETE /plan/holiday-calendars/:id non-existent returns 404', async () => {
|
||||
const { user } = createUser(testDb);
|
||||
const { user } = await makeUser(orm);
|
||||
await request(app).get('/api/addons/vacay/plan').set('Cookie', authCookie(user.id));
|
||||
|
||||
const res = await request(app)
|
||||
@@ -336,8 +330,8 @@ describe('Vacay holiday calendar CRUD', () => {
|
||||
|
||||
describe('Vacay invite full flow', () => {
|
||||
it('VACAY-028 — POST /invite/accept joins the invitee to the owner plan', async () => {
|
||||
const { user: owner } = createUser(testDb);
|
||||
const { user: invitee } = createUser(testDb);
|
||||
const { user: owner } = await makeUser(orm);
|
||||
const { user: invitee } = await makeUser(orm);
|
||||
|
||||
// Owner creates plan
|
||||
const planRes = await request(app).get('/api/addons/vacay/plan').set('Cookie', authCookie(owner.id));
|
||||
@@ -359,8 +353,8 @@ describe('Vacay invite full flow', () => {
|
||||
});
|
||||
|
||||
it('VACAY-029 — POST /invite/decline removes the pending invite', async () => {
|
||||
const { user: owner } = createUser(testDb);
|
||||
const { user: invitee } = createUser(testDb);
|
||||
const { user: owner } = await makeUser(orm);
|
||||
const { user: invitee } = await makeUser(orm);
|
||||
|
||||
const planRes = await request(app).get('/api/addons/vacay/plan').set('Cookie', authCookie(owner.id));
|
||||
const planId = planRes.body.plan.id;
|
||||
@@ -379,8 +373,8 @@ describe('Vacay invite full flow', () => {
|
||||
});
|
||||
|
||||
it('VACAY-030 — POST /invite/cancel removes the pending invite from owner side', async () => {
|
||||
const { user: owner } = createUser(testDb);
|
||||
const { user: invitee } = createUser(testDb);
|
||||
const { user: owner } = await makeUser(orm);
|
||||
const { user: invitee } = await makeUser(orm);
|
||||
|
||||
await request(app).get('/api/addons/vacay/plan').set('Cookie', authCookie(owner.id));
|
||||
|
||||
@@ -400,7 +394,7 @@ describe('Vacay invite full flow', () => {
|
||||
|
||||
describe('Vacay company holidays', () => {
|
||||
it('VACAY-032 — POST /entries/company-holiday toggles a company holiday', async () => {
|
||||
const { user } = createUser(testDb);
|
||||
const { user } = await makeUser(orm);
|
||||
await request(app).get('/api/addons/vacay/plan').set('Cookie', authCookie(user.id));
|
||||
await request(app).post('/api/addons/vacay/years').set('Cookie', authCookie(user.id)).send({ year: 2025 });
|
||||
|
||||
@@ -412,7 +406,7 @@ describe('Vacay company holidays', () => {
|
||||
});
|
||||
|
||||
it('VACAY-032b — POST /entries/company-holiday takes a half day and refuses any other size (#2439)', async () => {
|
||||
const { user } = createUser(testDb);
|
||||
const { user } = await makeUser(orm);
|
||||
await request(app).get('/api/addons/vacay/plan').set('Cookie', authCookie(user.id));
|
||||
await request(app).post('/api/addons/vacay/years').set('Cookie', authCookie(user.id)).send({ year: 2025 });
|
||||
const half = await request(app)
|
||||
@@ -429,8 +423,8 @@ describe('Vacay company holidays', () => {
|
||||
});
|
||||
|
||||
it('VACAY-033 — POST /entries/toggle with target_user_id not in plan returns 403', async () => {
|
||||
const { user: owner } = createUser(testDb);
|
||||
const { user: outsider } = createUser(testDb);
|
||||
const { user: owner } = await makeUser(orm);
|
||||
const { user: outsider } = await makeUser(orm);
|
||||
await request(app).get('/api/addons/vacay/plan').set('Cookie', authCookie(owner.id));
|
||||
await request(app).post('/api/addons/vacay/years').set('Cookie', authCookie(owner.id)).send({ year: 2025 });
|
||||
|
||||
@@ -444,8 +438,8 @@ describe('Vacay company holidays', () => {
|
||||
|
||||
describe('Vacay stats restrictions', () => {
|
||||
it('VACAY-034 — PUT /stats/:year for user not in plan returns 403', async () => {
|
||||
const { user: owner } = createUser(testDb);
|
||||
const { user: outsider } = createUser(testDb);
|
||||
const { user: owner } = await makeUser(orm);
|
||||
const { user: outsider } = await makeUser(orm);
|
||||
await request(app).get('/api/addons/vacay/plan').set('Cookie', authCookie(owner.id));
|
||||
await request(app).post('/api/addons/vacay/years').set('Cookie', authCookie(owner.id)).send({ year: 2025 });
|
||||
|
||||
@@ -459,8 +453,8 @@ describe('Vacay stats restrictions', () => {
|
||||
|
||||
describe('Vacay color restriction', () => {
|
||||
it('VACAY-036 — PUT /color with target_user_id not in plan returns 403', async () => {
|
||||
const { user: owner } = createUser(testDb);
|
||||
const { user: outsider } = createUser(testDb);
|
||||
const { user: owner } = await makeUser(orm);
|
||||
const { user: outsider } = await makeUser(orm);
|
||||
await request(app).get('/api/addons/vacay/plan').set('Cookie', authCookie(owner.id));
|
||||
|
||||
const res = await request(app)
|
||||
@@ -473,8 +467,8 @@ describe('Vacay color restriction', () => {
|
||||
|
||||
describe('Vacay toggle entry for plan member', () => {
|
||||
it('VACAY-038 — POST /entries/toggle with target_user_id in plan toggles their entry', async () => {
|
||||
const { user: owner } = createUser(testDb);
|
||||
const { user: invitee } = createUser(testDb);
|
||||
const { user: owner } = await makeUser(orm);
|
||||
const { user: invitee } = await makeUser(orm);
|
||||
|
||||
const planRes = await request(app).get('/api/addons/vacay/plan').set('Cookie', authCookie(owner.id));
|
||||
const planId = planRes.body.plan.id;
|
||||
@@ -501,8 +495,8 @@ describe('Vacay toggle entry for plan member', () => {
|
||||
|
||||
describe('Vacay read-only calendar shares', () => {
|
||||
it('VACAY-039 — POST /shares shares the calendar with another user', async () => {
|
||||
const { user: a } = createUser(testDb);
|
||||
const { user: b } = createUser(testDb);
|
||||
const { user: a } = await makeUser(orm);
|
||||
const { user: b } = await makeUser(orm);
|
||||
await request(app).get('/api/addons/vacay/plan').set('Cookie', authCookie(a.id));
|
||||
|
||||
const res = await request(app)
|
||||
@@ -514,8 +508,8 @@ describe('Vacay read-only calendar shares', () => {
|
||||
});
|
||||
|
||||
it('VACAY-040 — GET /shares lists the share as outgoing for A and incoming for B', async () => {
|
||||
const { user: a } = createUser(testDb);
|
||||
const { user: b } = createUser(testDb);
|
||||
const { user: a } = await makeUser(orm);
|
||||
const { user: b } = await makeUser(orm);
|
||||
await request(app).get('/api/addons/vacay/plan').set('Cookie', authCookie(a.id));
|
||||
await request(app).post('/api/addons/vacay/shares').set('Cookie', authCookie(a.id)).send({ user_id: b.id });
|
||||
|
||||
@@ -534,8 +528,8 @@ describe('Vacay read-only calendar shares', () => {
|
||||
});
|
||||
|
||||
it('VACAY-041 — GET /shares/calendars/:year exposes A entries and company holidays to B', async () => {
|
||||
const { user: a } = createUser(testDb);
|
||||
const { user: b } = createUser(testDb);
|
||||
const { user: a } = await makeUser(orm);
|
||||
const { user: b } = await makeUser(orm);
|
||||
await request(app).get('/api/addons/vacay/plan').set('Cookie', authCookie(a.id));
|
||||
await request(app).post('/api/addons/vacay/years').set('Cookie', authCookie(a.id)).send({ year: 2025 });
|
||||
await request(app)
|
||||
@@ -562,8 +556,8 @@ describe('Vacay read-only calendar shares', () => {
|
||||
});
|
||||
|
||||
it('VACAY-042 — PUT /shares/:id lets B hide the shared calendar', async () => {
|
||||
const { user: a } = createUser(testDb);
|
||||
const { user: b } = createUser(testDb);
|
||||
const { user: a } = await makeUser(orm);
|
||||
const { user: b } = await makeUser(orm);
|
||||
await request(app).get('/api/addons/vacay/plan').set('Cookie', authCookie(a.id));
|
||||
await request(app).post('/api/addons/vacay/shares').set('Cookie', authCookie(a.id)).send({ user_id: b.id });
|
||||
const list = await request(app).get('/api/addons/vacay/shares').set('Cookie', authCookie(b.id));
|
||||
@@ -581,8 +575,8 @@ describe('Vacay read-only calendar shares', () => {
|
||||
});
|
||||
|
||||
it('VACAY-043 — DELETE /shares/:id lets B remove the share', async () => {
|
||||
const { user: a } = createUser(testDb);
|
||||
const { user: b } = createUser(testDb);
|
||||
const { user: a } = await makeUser(orm);
|
||||
const { user: b } = await makeUser(orm);
|
||||
await request(app).get('/api/addons/vacay/plan').set('Cookie', authCookie(a.id));
|
||||
await request(app).post('/api/addons/vacay/shares').set('Cookie', authCookie(a.id)).send({ user_id: b.id });
|
||||
const list = await request(app).get('/api/addons/vacay/shares').set('Cookie', authCookie(b.id));
|
||||
@@ -599,9 +593,9 @@ describe('Vacay read-only calendar shares', () => {
|
||||
});
|
||||
|
||||
it('VACAY-044 — PUT/DELETE on a foreign share id returns 404', async () => {
|
||||
const { user: a } = createUser(testDb);
|
||||
const { user: b } = createUser(testDb);
|
||||
const { user: c } = createUser(testDb);
|
||||
const { user: a } = await makeUser(orm);
|
||||
const { user: b } = await makeUser(orm);
|
||||
const { user: c } = await makeUser(orm);
|
||||
await request(app).get('/api/addons/vacay/plan').set('Cookie', authCookie(a.id));
|
||||
await request(app).post('/api/addons/vacay/shares').set('Cookie', authCookie(a.id)).send({ user_id: b.id });
|
||||
const list = await request(app).get('/api/addons/vacay/shares').set('Cookie', authCookie(b.id));
|
||||
@@ -618,8 +612,8 @@ describe('Vacay read-only calendar shares', () => {
|
||||
});
|
||||
|
||||
it('VACAY-045 — sharing with the same user twice returns 400', async () => {
|
||||
const { user: a } = createUser(testDb);
|
||||
const { user: b } = createUser(testDb);
|
||||
const { user: a } = await makeUser(orm);
|
||||
const { user: b } = await makeUser(orm);
|
||||
await request(app).get('/api/addons/vacay/plan').set('Cookie', authCookie(a.id));
|
||||
await request(app).post('/api/addons/vacay/shares').set('Cookie', authCookie(a.id)).send({ user_id: b.id });
|
||||
|
||||
@@ -634,7 +628,7 @@ describe('Vacay read-only calendar shares', () => {
|
||||
|
||||
describe('Vacay public holidays', () => {
|
||||
it('VACAY-035 — returns 502 when the external API fetch fails', async () => {
|
||||
const { user } = createUser(testDb);
|
||||
const { user } = await makeUser(orm);
|
||||
vi.mocked(global.fetch as any).mockRejectedValueOnce(new Error('Network error'));
|
||||
|
||||
const res = await request(app).get('/api/addons/vacay/holidays/2099/ZZ').set('Cookie', authCookie(user.id));
|
||||
@@ -642,7 +636,7 @@ describe('Vacay public holidays', () => {
|
||||
});
|
||||
|
||||
it('VACAY-037 — adapts a Nager v4 record when the external API succeeds', async () => {
|
||||
const { user } = createUser(testDb);
|
||||
const { user } = await makeUser(orm);
|
||||
vi.mocked(global.fetch as any).mockResolvedValueOnce({
|
||||
ok: true,
|
||||
json: () =>
|
||||
|
||||
Reference in New Issue
Block a user