|
|
@@ -39,6 +39,25 @@ describe('OperationsLearningReportsComponent', () => {
|
|
|
expect(element.textContent).toContain('66.7%');
|
|
|
});
|
|
|
|
|
|
+ it('refreshes the current report data without invoking legacy sync or showing its old status', async () => {
|
|
|
+ const component = fixture.componentInstance;
|
|
|
+ const currentPage = component.data()!;
|
|
|
+ operations.learningReports.and.resolveTo({
|
|
|
+ ...currentPage,
|
|
|
+ sourceStatus: { ...sourceStatus, state: 'delayed', label: '学习记录同步延迟', message: '旧系统 19108 条,新数据库 19111 条' },
|
|
|
+ });
|
|
|
+ operations.learningReports.calls.reset();
|
|
|
+
|
|
|
+ await component.load(true);
|
|
|
+ fixture.detectChanges();
|
|
|
+
|
|
|
+ expect(operations.learningReports).toHaveBeenCalledWith(1, 20, '', jasmine.objectContaining({ studentObjectId: 'student-1' }), false);
|
|
|
+ const text = (fixture.nativeElement as HTMLElement).textContent || '';
|
|
|
+ expect(text).toContain('学习报表已刷新');
|
|
|
+ expect(text).not.toContain('学习记录同步延迟');
|
|
|
+ expect(text).not.toContain('旧系统 19108 条');
|
|
|
+ });
|
|
|
+
|
|
|
it('opens the complete word report through the detail cloud operation', async () => {
|
|
|
await fixture.componentInstance.open('study-common-1');
|
|
|
fixture.detectChanges();
|