test: update attendance service mocks

This commit is contained in:
2026-07-16 11:01:24 +08:00
parent c93ac986aa
commit 4fbcde48b1
2 changed files with 9 additions and 1 deletions

View File

@@ -21,6 +21,7 @@ const createService = () => {
create: jest.fn((value: Record<string, unknown>) => ({ id: 90, ...value })),
save: jest.fn(async (value: unknown) => value),
};
const attendanceDeviceRepo = { find: jest.fn().mockResolvedValue([]) };
const dataSource = {
transaction: jest.fn(
async (cb: (manager: { getRepository: jest.Mock }) => Promise<unknown>) => {
@@ -43,9 +44,10 @@ const createService = () => {
{} as never,
{} as never,
sessionRepo as never,
attendanceDeviceRepo as never,
dataSource as unknown as DataSource,
);
return { service, attendanceRepo, dingRawRepo, scheduleRepo, classStudentRepo, sessionRepo, dataSource };
return { service, attendanceRepo, dingRawRepo, scheduleRepo, classStudentRepo, sessionRepo, attendanceDeviceRepo, dataSource };
};
const endedSchedule = {