diff --git a/frontend/angular.json b/frontend/angular.json index bf33090e702..e2c566f72d6 100644 --- a/frontend/angular.json +++ b/frontend/angular.json @@ -94,21 +94,55 @@ "include": ["**/*.spec.ts"], "setupFiles": ["src/jsdom-svg-polyfill.ts"], "exclude": [ - "**/workflow-result.service.spec.ts", - "**/download.service.spec.ts", - "**/preset.service.spec.ts", - "**/*.component.spec.ts", - "**/coeditor-presence.service.spec.ts", - "**/execute-workflow.service.spec.ts", - "**/user.service.spec.ts", - "**/workflow-websocket.service.spec.ts", - "**/workflow-result-export.service.spec.ts", - "**/udf-debug.service.spec.ts", - "**/user-config.service.spec.ts", - "**/operator-menu.service.spec.ts", - "**/workflow-console.service.spec.ts", - "**/operator-reuse-cache-status.service.spec.ts", - "**/drag-drop.service.spec.ts" + "**/drag-drop.service.spec.ts", + "**/app/common/formly/preset-wrapper/preset-wrapper.component.spec.ts", + "**/app/common/service/user/config/user-config.service.spec.ts", + "**/app/common/service/user/user.service.spec.ts", + "**/app/dashboard/component/admin/execution/admin-execution.component.spec.ts", + "**/app/dashboard/component/admin/settings/admin-settings.component.spec.ts", + "**/app/dashboard/component/admin/user/admin-user.component.spec.ts", + "**/app/dashboard/component/dashboard.component.spec.ts", + "**/app/dashboard/component/user/filters-instructions/filters-instructions.component.spec.ts", + "**/app/dashboard/component/user/filters/filters.component.spec.ts", + "**/app/dashboard/component/user/list-item/list-item.component.spec.ts", + "**/app/dashboard/component/user/user-avatar/user-avatar.component.spec.ts", + "**/app/dashboard/component/user/user-computing-unit/user-computing-unit.component.spec.ts", + "**/app/dashboard/component/user/user-dataset/user-dataset-explorer/user-dataset-file-renderer/user-dataset-file-renderer.component.spec.ts", + "**/app/dashboard/component/user/user-icon/user-icon.component.spec.ts", + "**/app/dashboard/component/user/user-project/user-project-list-item/user-project-list-item.component.spec.ts", + "**/app/dashboard/component/user/user-quota/user-quota.component.spec.ts", + "**/app/dashboard/component/user/user-workflow/user-workflow-list-item/user-workflow-list-item.component.spec.ts", + "**/app/dashboard/component/user/user-workflow/user-workflow.component.spec.ts", + "**/app/hub/component/about/about.component.spec.ts", + "**/app/hub/component/browse-section/browse-section.component.spec.ts", + "**/app/workspace/component/code-editor-dialog/breakpoint-condition-input/breakpoint-condition-input.component.spec.ts", + "**/app/workspace/component/code-editor-dialog/code-debugger.component.spec.ts", + "**/app/workspace/component/code-editor-dialog/code-editor.component.spec.ts", + "**/app/workspace/component/codearea-custom-template/codearea-custom-template.component.spec.ts", + "**/app/workspace/component/left-panel/left-panel.component.spec.ts", + "**/app/workspace/component/left-panel/operator-menu/operator-label/operator-label.component.spec.ts", + "**/app/workspace/component/left-panel/operator-menu/operator-menu.component.spec.ts", + "**/app/workspace/component/left-panel/settings/settings.component.spec.ts", + "**/app/workspace/component/left-panel/time-travel/time-travel.component.spec.ts", + "**/app/workspace/component/left-panel/versions-list/versions-list.component.spec.ts", + "**/app/workspace/component/menu/coeditor-user-icon/coeditor-user-icon.component.spec.ts", + "**/app/workspace/component/menu/menu.component.spec.ts", + "**/app/workspace/component/power-button/computing-unit-selection.component.spec.ts", + "**/app/workspace/component/property-editor/operator-property-edit-frame/operator-property-edit-frame.component.spec.ts", + "**/app/workspace/component/property-editor/port-property-edit-frame/port-property-edit-frame.component.spec.ts", + "**/app/workspace/component/property-editor/property-editor.component.spec.ts", + "**/app/workspace/component/property-editor/typecasting-display/type-casting-display.component.spec.ts", + "**/app/workspace/component/result-panel/console-frame/console-frame.component.spec.ts", + "**/app/workspace/component/result-panel/error-frame/error-frame.component.spec.ts", + "**/app/workspace/component/result-panel/result-panel.component.spec.ts", + "**/app/workspace/component/result-panel/result-table-frame/result-table-frame.component.spec.ts", + "**/app/workspace/component/workflow-editor/context-menu/context-menu/context-menu.component.spec.ts", + "**/app/workspace/component/workflow-editor/mini-map/mini-map.component.spec.ts", + "**/app/workspace/component/workflow-editor/workflow-editor.component.spec.ts", + "**/app/workspace/component/workspace.component.spec.ts", + "**/app/workspace/service/execute-workflow/execute-workflow.service.spec.ts", + "**/app/workspace/service/preset/preset.service.spec.ts", + "**/app/workspace/service/workflow-graph/model/coeditor-presence.service.spec.ts" ] } } diff --git a/frontend/src/app/common/formly/preset-wrapper/preset-wrapper.component.spec.ts b/frontend/src/app/common/formly/preset-wrapper/preset-wrapper.component.spec.ts index f7a79fae322..6fd1418ff46 100644 --- a/frontend/src/app/common/formly/preset-wrapper/preset-wrapper.component.spec.ts +++ b/frontend/src/app/common/formly/preset-wrapper/preset-wrapper.component.spec.ts @@ -108,7 +108,7 @@ // vi.spyOn(presetService, "applyPreset"); // component.applyPreset(testPreset); -// expect(presetService.applyPreset).toHaveBeenCalledOnceWith( +// expect(presetService.applyPreset).toHaveBeenCalledExactlyOnceWith( // presetKey.presetType, // presetKey.applyTarget, // testPreset @@ -218,7 +218,7 @@ // const dropdownEntry = nonNull(dropdown.querySelector(".dropdown-entry")); // expect(dropdown.childElementCount).toEqual(component.searchResults.length); // dropdownEntry.dispatchEvent(new Event("click")); -// expect(component.applyPreset).toHaveBeenCalledOnceWith(testPreset); +// expect(component.applyPreset).toHaveBeenCalledExactlyOnceWith(testPreset); // })); // it("should delete the preset if a preset entry's delete button is clicked", fakeAsync(() => { @@ -243,7 +243,7 @@ // const dropdownDeleteButton = nonNull(dropdown.querySelector(".delete-button")); // expect(dropdown.childElementCount).toEqual(component.searchResults.length); // dropdownDeleteButton.dispatchEvent(new Event("click")); -// expect(component.deletePreset).toHaveBeenCalledOnceWith(testPreset); +// expect(component.deletePreset).toHaveBeenCalledExactlyOnceWith(testPreset); // })); // it("should set new search results whenever the value of the field changes", fakeAsync(() => { diff --git a/frontend/src/app/dashboard/component/user/user-workflow/user-workflow-list-item/user-workflow-list-item.component.spec.ts b/frontend/src/app/dashboard/component/user/user-workflow/user-workflow-list-item/user-workflow-list-item.component.spec.ts index f27acb25fa6..afade001231 100644 --- a/frontend/src/app/dashboard/component/user/user-workflow/user-workflow-list-item/user-workflow-list-item.component.spec.ts +++ b/frontend/src/app/dashboard/component/user/user-workflow/user-workflow-list-item/user-workflow-list-item.component.spec.ts @@ -63,7 +63,7 @@ describe("UserWorkflowListItemComponent", () => { it("sends http request to backend to retrieve export json", () => { // Test the workflow download button. component.onClickDownloadWorkfllow(); - expect(fileSaverServiceSpy.saveAs).toHaveBeenCalledOnceWith( + expect(fileSaverServiceSpy.saveAs).toHaveBeenCalledExactlyOnceWith( new Blob([JSON.stringify(testWorkflowEntries[0].workflow.workflow.content)], { type: "text/plain;charset=utf-8", }), diff --git a/frontend/src/app/dashboard/component/user/user-workflow/user-workflow.component.spec.ts b/frontend/src/app/dashboard/component/user/user-workflow/user-workflow.component.spec.ts index a8ff133e6be..2e9b1111015 100644 --- a/frontend/src/app/dashboard/component/user/user-workflow/user-workflow.component.spec.ts +++ b/frontend/src/app/dashboard/component/user/user-workflow/user-workflow.component.spec.ts @@ -128,7 +128,7 @@ describe("SavedWorkflowSectionComponent", () => { }); // TODO: add this test case back and figure out why it failed - // xit("Modal Opened, then Closed", () => { + // it.skip("Modal Opened, then Closed", () => { // const modalRef: NgbModalRef = modalService.open(NgbdModalWorkflowShareAccessComponent); // vi.spyOn(modalService, "open").mockReturnValue(modalRef); // component.onClickOpenShareAccess(testWorkflowEntries[0]); diff --git a/frontend/src/app/dashboard/service/user/download/download.service.spec.ts b/frontend/src/app/dashboard/service/user/download/download.service.spec.ts index 4396948ae37..4a9e17729a8 100644 --- a/frontend/src/app/dashboard/service/user/download/download.service.spec.ts +++ b/frontend/src/app/dashboard/service/user/download/download.service.spec.ts @@ -16,6 +16,10 @@ * specific language governing permissions and limitations * under the License. */ +// TODO: rewrite skipped tests away from Jasmine done/fail callbacks (#4861). +// These stubs make the it.skip bodies type-check without running. +declare function done(): void; +declare function fail(message?: string): never; // TODO(vitest): done callbacks need rewrite to async/Promise pattern; these specs are skipped pending follow-up — tracked in #4861. diff --git a/frontend/src/app/workspace/component/code-editor-dialog/code-debugger.component.spec.ts b/frontend/src/app/workspace/component/code-editor-dialog/code-debugger.component.spec.ts index a39bf65a705..c974ee8cd50 100644 --- a/frontend/src/app/workspace/component/code-editor-dialog/code-debugger.component.spec.ts +++ b/frontend/src/app/workspace/component/code-editor-dialog/code-debugger.component.spec.ts @@ -65,7 +65,7 @@ describe("CodeDebuggerComponent", () => { // Set required input properties component.currentOperatorId = operatorId; - component.monacoEditor = { dispose: vi.fn() }; + component.monacoEditor = { dispose: vi.fn() } as any; // Trigger change detection to ensure view updates fixture.detectChanges(); diff --git a/frontend/src/app/workspace/component/property-editor/operator-property-edit-frame/operator-property-edit-frame.component.spec.ts b/frontend/src/app/workspace/component/property-editor/operator-property-edit-frame/operator-property-edit-frame.component.spec.ts index 8c592b52634..8661bec28a3 100644 --- a/frontend/src/app/workspace/component/property-editor/operator-property-edit-frame/operator-property-edit-frame.component.spec.ts +++ b/frontend/src/app/workspace/component/property-editor/operator-property-edit-frame/operator-property-edit-frame.component.spec.ts @@ -181,7 +181,7 @@ describe("OperatorPropertyEditFrameComponent", () => { expect(emitEventCounter).toEqual(1); })); - xit( + it.skip( "should debounce the user form input to avoid emitting event too frequently", marbles(m => { const jointGraphWrapper = workflowActionService.getJointGraphWrapper(); diff --git a/frontend/src/app/workspace/component/workflow-editor/context-menu/context-menu/context-menu.component.spec.ts b/frontend/src/app/workspace/component/workflow-editor/context-menu/context-menu/context-menu.component.spec.ts index 34428f5947b..89a02db30f4 100644 --- a/frontend/src/app/workspace/component/workflow-editor/context-menu/context-menu/context-menu.component.spec.ts +++ b/frontend/src/app/workspace/component/workflow-editor/context-menu/context-menu/context-menu.component.spec.ts @@ -71,9 +71,9 @@ describe("ContextMenuComponent", () => { workflowActionServiceSpy.getJointGraphWrapper.mockReturnValue(jointGraphWrapperSpy); workflowActionServiceSpy.getWorkflowModificationEnabledStream.mockReturnValue(of(true)); workflowActionServiceSpy.getTexeraGraph.mockReturnValue(texeraGraphSpy); - workflowActionServiceSpy.deleteOperatorsAndLinks.mockReturnValue(); - workflowActionServiceSpy.deleteCommentBox.mockReturnValue(); - workflowActionServiceSpy.deleteLinkWithID.mockReturnValue(); + workflowActionServiceSpy.deleteOperatorsAndLinks.mockReturnValue(undefined); + workflowActionServiceSpy.deleteCommentBox.mockReturnValue(undefined); + workflowActionServiceSpy.deleteLinkWithID.mockReturnValue(undefined); workflowActionServiceSpy.getWorkflowMetadata.mockReturnValue({ name: "Test Workflow" }); // Mock return value // Set up TexeraGraph spy return values diff --git a/frontend/src/app/workspace/service/preset/preset.service.spec.ts b/frontend/src/app/workspace/service/preset/preset.service.spec.ts index b82244da5db..458aefb0f30 100644 --- a/frontend/src/app/workspace/service/preset/preset.service.spec.ts +++ b/frontend/src/app/workspace/service/preset/preset.service.spec.ts @@ -16,6 +16,10 @@ * specific language governing permissions and limitations * under the License. */ +// TODO: rewrite skipped tests away from Jasmine done/fail callbacks (#4861). +// These stubs make the it.skip bodies type-check without running. +declare function done(): void; +declare function fail(message?: string): never; // TODO(vitest): done callbacks need rewrite to async/Promise pattern; these specs are skipped pending follow-up — tracked in #4861. diff --git a/frontend/src/tsconfig.spec.json b/frontend/src/tsconfig.spec.json index f84b48d5f2e..936cf0415c6 100644 --- a/frontend/src/tsconfig.spec.json +++ b/frontend/src/tsconfig.spec.json @@ -11,33 +11,65 @@ }, "include": ["**/*.spec.ts", "**/*.d.ts", "vitest-globals.d.ts", "jsdom-svg-polyfill.ts"], "exclude": [ - // Component specs deferred to a follow-up PR. They pull entire - // template trees through the spec compile; the new unit-test builder - // does stricter component / module resolution than the legacy karma - // path and surfaces hundreds of "is not a known property/element" - // errors that boil down to standalone vs NgModule scope mismatch in - // the existing TestBed setups. Re-enabling them is tracked in #4861. - "**/*.component.spec.ts", - // Service specs that transitively pull a NgModule-declared component - // through their import chain (most reach `auth.service` → - // `RegistrationRequestModalComponent`, whose template fails the same - // type check). Deferred for the same follow-up. - "**/coeditor-presence.service.spec.ts", - "**/execute-workflow.service.spec.ts", - "**/user.service.spec.ts", - "**/workflow-websocket.service.spec.ts", - "**/workflow-result-export.service.spec.ts", - "**/udf-debug.service.spec.ts", - "**/user-config.service.spec.ts", - "**/operator-menu.service.spec.ts", - "**/workflow-console.service.spec.ts", - "**/operator-reuse-cache-status.service.spec.ts", - "**/workflow-result.service.spec.ts", - "**/download.service.spec.ts", - "**/preset.service.spec.ts", // jsdom polyfill is enough to instantiate jointjs but its zero- // dimension fake matrices break the actual graph-geometry math - // these tests assert on. Real fix is Vitest browser mode (#4861). - "**/drag-drop.service.spec.ts" + // these tests assert on. Real fix is Vitest browser mode (#4866). + "**/drag-drop.service.spec.ts", + + // Component / service specs whose TestBed setups still need to be + // adapted to the standalone-component world. The migration sweep + // (PR #4862 + PR #4873) made the runtime resolution succeed, but + // each TestBed configures `declarations: [...]` plus selective + // module imports — that combo no longer matches what the new + // builder expects from a standalone-component graph. Tracked as + // follow-ups under #4861. + "**/app/common/formly/preset-wrapper/preset-wrapper.component.spec.ts", + "**/app/common/service/user/config/user-config.service.spec.ts", + "**/app/common/service/user/user.service.spec.ts", + "**/app/dashboard/component/admin/execution/admin-execution.component.spec.ts", + "**/app/dashboard/component/admin/settings/admin-settings.component.spec.ts", + "**/app/dashboard/component/admin/user/admin-user.component.spec.ts", + "**/app/dashboard/component/dashboard.component.spec.ts", + "**/app/dashboard/component/user/filters-instructions/filters-instructions.component.spec.ts", + "**/app/dashboard/component/user/filters/filters.component.spec.ts", + "**/app/dashboard/component/user/list-item/list-item.component.spec.ts", + "**/app/dashboard/component/user/user-avatar/user-avatar.component.spec.ts", + "**/app/dashboard/component/user/user-computing-unit/user-computing-unit.component.spec.ts", + "**/app/dashboard/component/user/user-dataset/user-dataset-explorer/user-dataset-file-renderer/user-dataset-file-renderer.component.spec.ts", + "**/app/dashboard/component/user/user-icon/user-icon.component.spec.ts", + "**/app/dashboard/component/user/user-project/user-project-list-item/user-project-list-item.component.spec.ts", + "**/app/dashboard/component/user/user-quota/user-quota.component.spec.ts", + "**/app/dashboard/component/user/user-workflow/user-workflow-list-item/user-workflow-list-item.component.spec.ts", + "**/app/dashboard/component/user/user-workflow/user-workflow.component.spec.ts", + "**/app/hub/component/about/about.component.spec.ts", + "**/app/hub/component/browse-section/browse-section.component.spec.ts", + "**/app/workspace/component/code-editor-dialog/breakpoint-condition-input/breakpoint-condition-input.component.spec.ts", + "**/app/workspace/component/code-editor-dialog/code-debugger.component.spec.ts", + "**/app/workspace/component/code-editor-dialog/code-editor.component.spec.ts", + "**/app/workspace/component/codearea-custom-template/codearea-custom-template.component.spec.ts", + "**/app/workspace/component/left-panel/left-panel.component.spec.ts", + "**/app/workspace/component/left-panel/operator-menu/operator-label/operator-label.component.spec.ts", + "**/app/workspace/component/left-panel/operator-menu/operator-menu.component.spec.ts", + "**/app/workspace/component/left-panel/settings/settings.component.spec.ts", + "**/app/workspace/component/left-panel/time-travel/time-travel.component.spec.ts", + "**/app/workspace/component/left-panel/versions-list/versions-list.component.spec.ts", + "**/app/workspace/component/menu/coeditor-user-icon/coeditor-user-icon.component.spec.ts", + "**/app/workspace/component/menu/menu.component.spec.ts", + "**/app/workspace/component/power-button/computing-unit-selection.component.spec.ts", + "**/app/workspace/component/property-editor/operator-property-edit-frame/operator-property-edit-frame.component.spec.ts", + "**/app/workspace/component/property-editor/port-property-edit-frame/port-property-edit-frame.component.spec.ts", + "**/app/workspace/component/property-editor/property-editor.component.spec.ts", + "**/app/workspace/component/property-editor/typecasting-display/type-casting-display.component.spec.ts", + "**/app/workspace/component/result-panel/console-frame/console-frame.component.spec.ts", + "**/app/workspace/component/result-panel/error-frame/error-frame.component.spec.ts", + "**/app/workspace/component/result-panel/result-panel.component.spec.ts", + "**/app/workspace/component/result-panel/result-table-frame/result-table-frame.component.spec.ts", + "**/app/workspace/component/workflow-editor/context-menu/context-menu/context-menu.component.spec.ts", + "**/app/workspace/component/workflow-editor/mini-map/mini-map.component.spec.ts", + "**/app/workspace/component/workflow-editor/workflow-editor.component.spec.ts", + "**/app/workspace/component/workspace.component.spec.ts", + "**/app/workspace/service/execute-workflow/execute-workflow.service.spec.ts", + "**/app/workspace/service/preset/preset.service.spec.ts", + "**/app/workspace/service/workflow-graph/model/coeditor-presence.service.spec.ts" ] }