test: harden business boundary conditions

This commit is contained in:
2026-07-15 00:03:55 +08:00
parent 17a5046ea0
commit b1f35f9d1a
65 changed files with 2311 additions and 293 deletions

View File

@@ -41,7 +41,10 @@ describe('ClassesService — teacher data scope', () => {
it('clears denormalized teacher ids when the last teacher for that role is removed', async () => {
const classRepo = { update: jest.fn() };
const classTeacherRepo = {
find: jest.fn().mockResolvedValue([]),
find: jest
.fn()
.mockResolvedValueOnce([{ id: 1, classId: 8, userId: 21 }])
.mockResolvedValueOnce([]),
delete: jest.fn().mockResolvedValue({ affected: 1 }),
};
const service = new ClassesService(