|
|
@@ -80,6 +80,19 @@ describe('payroll interactions', () => {
|
|
|
service.teachingStandards.and.rejectWith(new Error('标准服务暂不可用'));
|
|
|
await component.load();expect(component.overview()?.month).toBe('2026-09');expect(component.error()).toContain('工资标准');expect(component.error()).toContain('保留上次成功结果');expect(component.loading()).toBeFalse();
|
|
|
});
|
|
|
+ it('explains missing writing evidence before submitting a mapping',async()=>{
|
|
|
+ const row={appointmentId:'appointment',appointmentGeneralId:1,studentName:'灵灵',courseName:'阅读写作',startsAt:'2026-09-02 19:30',grade:'',categoryKey:'primary_writing',suggestedCategoryKey:'primary_writing',evidence:'',updatedAt:'2026-09-02T12:00:00.000Z'};
|
|
|
+ await component.saveWritingMapping(row);
|
|
|
+ expect(service.mutate).not.toHaveBeenCalled();
|
|
|
+ expect(component.error()).toContain('请填写“灵灵”的核对依据');
|
|
|
+ });
|
|
|
+ it('submits a writing mapping once its category and evidence are complete',async()=>{
|
|
|
+ const row={appointmentId:'appointment',appointmentGeneralId:1,studentName:'灵灵',courseName:'阅读写作',startsAt:'2026-09-02 19:30',grade:'',categoryKey:'primary_writing',suggestedCategoryKey:'primary_writing',evidence:' 已核实为小学 ',updatedAt:'2026-09-02T12:00:00.000Z'};
|
|
|
+ service.mutate.and.resolveTo({updated:true});
|
|
|
+ await component.saveWritingMapping(row);
|
|
|
+ expect(service.mutate).toHaveBeenCalledWith('ops/course-mappings/student-commit','appointment','按学员记录核对语法写作分类',{categoryKey:'primary_writing',evidence:'已核实为小学'},'2026-09-02T12:00:00.000Z');
|
|
|
+ expect(component.message()).toBe('该预约的学段分类已确认');
|
|
|
+ });
|
|
|
it('ignores an older batch page response',async()=>{
|
|
|
let resolveOld!:(v:unknown)=>void;service.payrolls.and.returnValues(new Promise(r=>resolveOld=r) as never,Promise.resolve({items:[],total:50,page:3,pageSize:20}));
|
|
|
const old=component.loadBatchPage(2);await component.loadBatchPage(3);resolveOld({items:[],total:50,page:2,pageSize:20});await old;expect(component.page()?.page).toBe(3);
|