chore: remove dead code and tune frontend chunks
This commit is contained in:
@@ -63,7 +63,7 @@ describe('AttendanceController — DingTalk import scope', () => {
|
||||
attendanceService.getTeacherClassDingUserIds.mockResolvedValue(['ding-1', 'ding-2']);
|
||||
|
||||
await controller.importFromDingTalk(
|
||||
{ start: '2026-07-01', end: '2026-07-02', classId: 8, autoMatch: true },
|
||||
{ start: '2026-07-01', end: '2026-07-02', classId: 8 },
|
||||
{ user: { id: 21, username: 'teacher', permissions: [], isSuperAdmin: false } } as never,
|
||||
);
|
||||
|
||||
@@ -79,7 +79,7 @@ describe('AttendanceController — DingTalk import scope', () => {
|
||||
it('does not allow a teacher to supply arbitrary DingTalk user IDs', async () => {
|
||||
await expect(
|
||||
controller.importFromDingTalk(
|
||||
{ start: '2026-07-01', end: '2026-07-02', users: 'someone-else', autoMatch: true },
|
||||
{ start: '2026-07-01', end: '2026-07-02', users: 'someone-else' },
|
||||
{ user: { id: 21, username: 'teacher', permissions: [], isSuperAdmin: false } } as never,
|
||||
),
|
||||
).rejects.toBeInstanceOf(ForbiddenException);
|
||||
@@ -89,7 +89,7 @@ describe('AttendanceController — DingTalk import scope', () => {
|
||||
|
||||
it('requires teachers to select one of their classes', async () => {
|
||||
await expect(
|
||||
controller.importFromDingTalk({ start: '2026-07-01', end: '2026-07-02', autoMatch: true }, {
|
||||
controller.importFromDingTalk({ start: '2026-07-01', end: '2026-07-02' }, {
|
||||
user: { id: 21, username: 'teacher', permissions: [], isSuperAdmin: false },
|
||||
} as never),
|
||||
).rejects.toBeInstanceOf(BadRequestException);
|
||||
@@ -106,11 +106,11 @@ describe('AttendanceController — DingTalk import scope', () => {
|
||||
expect(attendanceService.getImportableClasses).toHaveBeenCalledWith(21, false);
|
||||
});
|
||||
|
||||
it('always auto-matches class-scoped imports even if an old client sends autoMatch=false', async () => {
|
||||
it('always auto-matches class-scoped imports', async () => {
|
||||
attendanceService.getTeacherClassDingUserIds.mockResolvedValue(['ding-1']);
|
||||
|
||||
await controller.importFromDingTalk(
|
||||
{ start: '2026-07-01', end: '2026-07-02', classId: 8, autoMatch: false },
|
||||
{ start: '2026-07-01', end: '2026-07-02', classId: 8 },
|
||||
{ user: { id: 21, username: 'teacher', permissions: [], isSuperAdmin: false } } as never,
|
||||
);
|
||||
|
||||
@@ -137,7 +137,7 @@ describe('AttendanceController — DingTalk import scope', () => {
|
||||
expect(attendanceService.getImportableClasses).toHaveBeenCalledWith(7, true);
|
||||
|
||||
await controller.importFromDingTalk(
|
||||
{ start: '2026-07-01', end: '2026-07-02', users: 'ding-1,ding-2', autoMatch: true },
|
||||
{ start: '2026-07-01', end: '2026-07-02', users: 'ding-1,ding-2' },
|
||||
{
|
||||
user: {
|
||||
id: 7,
|
||||
|
||||
Reference in New Issue
Block a user