Skip to content

Commit 13bd81d

Browse files
committed
test: 适配默认人工核对与备份第 12 版
E2E 场景用户显式关闭导入前人工核对,保持原有直接入库流程;备份版本断言改为 12。
1 parent a09b1d2 commit 13bd81d

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎e2e/data-backup.spec.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ test('[E2E-M07] 其他账号备份合并到当前账号并在同邮箱空账号
3131
await download.saveAs(file);
3232
const contents = readFileSync(file, 'utf8');
3333
const backup = JSON.parse(contents) as { version: number; user: Record<string, unknown>; errorItems: unknown[]; extensions?: unknown };
34-
expect(backup.version).toBe(11);
34+
expect(backup.version).toBe(12);
3535
expect(backup.extensions).toEqual({});
3636
expect(backup.errorItems).toHaveLength(2);
3737
expect(backup.user).not.toHaveProperty('password');

‎e2e/support/fixtures.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ export class Scenario {
7777
await this.db.user.updateMany({ where: { email: 'admin@localhost' }, data: { password: adminHash, aiDataConsentAt: new Date(), confirmBeforeImport: false, gradeRecognitionMode: 'fixed', fixedGradeSemester: null, enableSvgAnimation: false } });
7878
await this.db.user.updateMany({ where: { email: 'setup-admin@localhost' }, data: { password: defaultHash, aiDataConsentAt: new Date() } });
7979
this.user = await this.db.user.create({ data: { email: `a-${this.id}@example.test`, password: passwordHash, name: 'E2E 学生 A',
80-
educationStage: 'junior_high', enrollmentYear: 2025, fixedGradeSemester: '初二上', enableSvgAnimation: false, aiDataConsentAt: new Date() } });
80+
educationStage: 'junior_high', enrollmentYear: 2025, fixedGradeSemester: '初二上', enableSvgAnimation: false, aiDataConsentAt: new Date(), confirmBeforeImport: false } });
8181
this.otherUser = await this.db.user.create({ data: { email: `b-${this.id}@example.test`, password: passwordHash, name: 'E2E 学生 B',
82-
educationStage: 'junior_high', enrollmentYear: 2025, fixedGradeSemester: '初二上', enableSvgAnimation: false, aiDataConsentAt: new Date() } });
82+
educationStage: 'junior_high', enrollmentYear: 2025, fixedGradeSemester: '初二上', enableSvgAnimation: false, aiDataConsentAt: new Date(), confirmBeforeImport: false } });
8383
this.book = await this.db.subject.create({ data: { name: '数学', stage: 'junior_high', subjectKey: 'math', userId: this.user.id } });
8484
const entries = await Promise.all(['a', 'b', 'other'].map((key, order) => this.db.paperGroup.create({ data: {
8585
userId: this.user.id, key, name: ['A卷', 'B卷', '其他'][order], order,
@@ -112,7 +112,7 @@ export class Scenario {
112112
const email = this.user.email;
113113
await this.db.user.delete({ where: { id: this.user.id } });
114114
this.user = await this.db.user.create({ data: { email, password: passwordHash, name: 'E2E 恢复账号',
115-
educationStage: 'junior_high', enrollmentYear: 2025, fixedGradeSemester: '初二上', enableSvgAnimation: false, aiDataConsentAt: new Date() } });
115+
educationStage: 'junior_high', enrollmentYear: 2025, fixedGradeSemester: '初二上', enableSvgAnimation: false, aiDataConsentAt: new Date(), confirmBeforeImport: false } });
116116
}
117117

118118
async records() { return this.db.practiceRecord.findMany({ where: { userId: this.user.id }, orderBy: { createdAt: 'asc' } }); }

0 commit comments

Comments
 (0)