Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 49 additions & 15 deletions frontend/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Comment thread
Yicong-Huang marked this conversation as resolved.
"**/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",
Comment thread
Yicong-Huang marked this conversation as resolved.
"**/app/workspace/service/workflow-graph/model/coeditor-presence.service.spec.ts"
]
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
// vi.spyOn(presetService, "applyPreset");

// component.applyPreset(testPreset);
// expect(presetService.applyPreset).toHaveBeenCalledOnceWith(
// expect(presetService.applyPreset).toHaveBeenCalledExactlyOnceWith(
// presetKey.presetType,
// presetKey.applyTarget,
// testPreset
Expand Down Expand Up @@ -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(() => {
Expand All @@ -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(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
84 changes: 58 additions & 26 deletions frontend/src/tsconfig.spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Comment thread
Yicong-Huang marked this conversation as resolved.
"**/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",
Comment thread
Yicong-Huang marked this conversation as resolved.
"**/app/workspace/service/workflow-graph/model/coeditor-presence.service.spec.ts"
]
}
Loading