|
|
@@ -47,6 +47,16 @@ describe('OperationsLearningReportsComponent', () => {
|
|
|
expect((fixture.nativeElement as HTMLElement).textContent).toContain('21天复习计划');
|
|
|
});
|
|
|
|
|
|
+ it('offers download only after opening the preview and choosing a report version', async () => {
|
|
|
+ const element: HTMLElement = fixture.nativeElement;
|
|
|
+ expect(element.querySelector('.report-table button[aria-label="下载PDF"]')).toBeNull();
|
|
|
+ expect(element.querySelectorAll('.report-table button[aria-label="查看报表"]').length).toBe(1);
|
|
|
+ await fixture.componentInstance.open('study-common-1');
|
|
|
+ fixture.detectChanges();
|
|
|
+ expect(element.querySelector('.report-variants')).not.toBeNull();
|
|
|
+ expect(element.querySelector('.report-drawer button.ui-button.primary')?.textContent).toContain('下载 PDF');
|
|
|
+ });
|
|
|
+
|
|
|
it('submits every visible filter when the operator queries reports', async () => {
|
|
|
const component = fixture.componentInstance;
|
|
|
operations.learningReports.calls.reset();
|