This is an automated email from the ASF dual-hosted git repository.
Yicong-Huang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/texera.git
The following commit(s) were added to refs/heads/main by this push:
new 7cd34b17d1 chore(frontend): re-enable 13 component/service specs after
standalone migration (#4886)
7cd34b17d1 is described below
commit 7cd34b17d1cb544e8b21f2ddde6b1cb0e43b107e
Author: Yicong Huang <[email protected]>
AuthorDate: Sun May 3 20:06:28 2026 -0700
chore(frontend): re-enable 13 component/service specs after standalone
migration (#4886)
### What changes were proposed in this PR?
Drop 13 spec files from the exclusion lists and migrate their TestBed
setups to the standalone-component shape — `declarations: [Comp]`
becomes `imports: [Comp]`. The components are already standalone
post-#4873; the spec configs just needed the same treatment.
Specs re-enabled:
- `hub/about`, `hub/browse-section`
- `dashboard/user/filters-instructions`, `user-avatar`, `user-icon`,
`user-quota`
- `dashboard/user/filters` (adds `provideNzI18n(en_US)` for the date
pickers' locale lookup)
- `dashboard/user/list-item` (adds `RouterTestingModule` +
`StubUserService` for `[routerLink]` and the `AuthService` chain)
- `dashboard/user/user-computing-unit` (registers `FileAddOutline` via
`NzIconModule.forChild` since jsdom can't fetch icons over HTTP)
- `dashboard/user/user-dataset-file-renderer`
- `workspace/menu/coeditor-user-icon` (also rewrites `waitForAsync`
`beforeEach` -> `async/await` so it runs without an outer ProxyZone)
- `workspace/service/workflow-graph/model/coeditor-presence`
### Any related issues, documentation, discussions?
A slice of #4880.
### How was this PR tested?
`yarn ng test --watch=false` locally:
```
Test Files 33 passed | 3 skipped (36)
Tests 169 passed | 8 skipped | 2 todo (179)
```
Up from 21 / 150 on main.
### Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Opus 4.7 (1M context)
---------
Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
---
frontend/angular.json | 11 -----------
.../filters-instructions.component.spec.ts | 3 +--
.../component/user/filters/filters.component.spec.ts | 5 +++--
.../component/user/list-item/list-item.component.spec.ts | 7 +++++--
.../user/user-avatar/user-avatar.component.spec.ts | 3 +--
.../user-computing-unit.component.spec.ts | 5 +++--
.../user-dataset-file-renderer.component.spec.ts | 3 +--
.../component/user/user-icon/user-icon.component.spec.ts | 10 +++++-----
.../component/user/user-quota/user-quota.component.spec.ts | 3 +--
.../src/app/hub/component/about/about.component.spec.ts | 2 +-
.../browse-section/browse-section.component.spec.ts | 2 +-
.../coeditor-user-icon.component.spec.ts | 14 ++++++++------
.../workflow-graph/model/coeditor-presence.service.spec.ts | 3 +++
frontend/src/tsconfig.spec.json | 11 -----------
14 files changed, 33 insertions(+), 49 deletions(-)
diff --git a/frontend/angular.json b/frontend/angular.json
index ca9f127024..103c845759 100644
--- a/frontend/angular.json
+++ b/frontend/angular.json
@@ -101,19 +101,9 @@
"**/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",
@@ -124,7 +114,6 @@
"**/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",
diff --git
a/frontend/src/app/dashboard/component/user/filters-instructions/filters-instructions.component.spec.ts
b/frontend/src/app/dashboard/component/user/filters-instructions/filters-instructions.component.spec.ts
index 559f00a5a5..7cb675ad56 100644
---
a/frontend/src/app/dashboard/component/user/filters-instructions/filters-instructions.component.spec.ts
+++
b/frontend/src/app/dashboard/component/user/filters-instructions/filters-instructions.component.spec.ts
@@ -28,8 +28,7 @@ describe("FiltersInstructionsComponent", () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
- declarations: [FiltersInstructionsComponent],
- imports: [NzPopoverModule],
+ imports: [FiltersInstructionsComponent, NzPopoverModule],
}).compileComponents();
});
diff --git
a/frontend/src/app/dashboard/component/user/filters/filters.component.spec.ts
b/frontend/src/app/dashboard/component/user/filters/filters.component.spec.ts
index cb1bcb910d..50deeb4877 100644
---
a/frontend/src/app/dashboard/component/user/filters/filters.component.spec.ts
+++
b/frontend/src/app/dashboard/component/user/filters/filters.component.spec.ts
@@ -32,6 +32,7 @@ import { FormsModule } from "@angular/forms";
import { HttpClientTestingModule } from "@angular/common/http/testing";
import { commonTestProviders } from "src/app/common/testing/test-utils";
import { NzModalModule } from "ng-zorro-antd/modal";
+import { en_US, provideNzI18n } from "ng-zorro-antd/i18n";
describe("FiltersComponent", () => {
let component: FiltersComponent;
@@ -39,15 +40,15 @@ describe("FiltersComponent", () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
- declarations: [FiltersComponent],
providers: [
JwtHelperService,
{ provide: JWT_OPTIONS, useValue: {} },
{ provide: WorkflowPersistService, useValue: new
StubWorkflowPersistService(testWorkflowEntries) },
{ provide: OperatorMetadataService, useClass:
StubOperatorMetadataService },
+ provideNzI18n(en_US),
...commonTestProviders,
],
- imports: [NzModalModule, NzDropDownModule, FormsModule,
HttpClientTestingModule],
+ imports: [FiltersComponent, NzModalModule, NzDropDownModule,
FormsModule, HttpClientTestingModule],
schemas: [NO_ERRORS_SCHEMA],
}).compileComponents();
});
diff --git
a/frontend/src/app/dashboard/component/user/list-item/list-item.component.spec.ts
b/frontend/src/app/dashboard/component/user/list-item/list-item.component.spec.ts
index 2eaf567a3b..a3d5360aa3 100644
---
a/frontend/src/app/dashboard/component/user/list-item/list-item.component.spec.ts
+++
b/frontend/src/app/dashboard/component/user/list-item/list-item.component.spec.ts
@@ -25,6 +25,9 @@ import { NzModalService } from "ng-zorro-antd/modal";
import { of, throwError } from "rxjs";
import { NO_ERRORS_SCHEMA } from "@angular/core";
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
+import { RouterTestingModule } from "@angular/router/testing";
+import { StubUserService } from
"../../../../common/service/user/stub-user.service";
+import { UserService } from "../../../../common/service/user/user.service";
import { commonTestProviders } from "../../../../common/testing/test-utils";
import type { Mocked } from "vitest";
describe("ListItemComponent", () => {
@@ -36,10 +39,10 @@ describe("ListItemComponent", () => {
const workflowPersistServiceSpy = { updateWorkflowName: vi.fn(),
updateWorkflowDescription: vi.fn() };
await TestBed.configureTestingModule({
- imports: [HttpClientTestingModule, BrowserAnimationsModule],
- declarations: [ListItemComponent],
+ imports: [ListItemComponent, HttpClientTestingModule,
BrowserAnimationsModule, RouterTestingModule],
providers: [
{ provide: WorkflowPersistService, useValue: workflowPersistServiceSpy
},
+ { provide: UserService, useClass: StubUserService },
NzModalService,
...commonTestProviders,
],
diff --git
a/frontend/src/app/dashboard/component/user/user-avatar/user-avatar.component.spec.ts
b/frontend/src/app/dashboard/component/user/user-avatar/user-avatar.component.spec.ts
index b9c38bf7b5..1afed37712 100644
---
a/frontend/src/app/dashboard/component/user/user-avatar/user-avatar.component.spec.ts
+++
b/frontend/src/app/dashboard/component/user/user-avatar/user-avatar.component.spec.ts
@@ -32,8 +32,7 @@ describe("UserAvatarComponent", () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
- declarations: [UserAvatarComponent],
- imports: [HttpClientModule, HttpClientTestingModule, NzAvatarModule],
+ imports: [UserAvatarComponent, HttpClientModule,
HttpClientTestingModule, NzAvatarModule],
providers: [{ provide: UserService, useClass: StubUserService },
...commonTestProviders],
}).compileComponents();
});
diff --git
a/frontend/src/app/dashboard/component/user/user-computing-unit/user-computing-unit.component.spec.ts
b/frontend/src/app/dashboard/component/user/user-computing-unit/user-computing-unit.component.spec.ts
index 09d040dbc6..707ce3ebcf 100644
---
a/frontend/src/app/dashboard/component/user/user-computing-unit/user-computing-unit.component.spec.ts
+++
b/frontend/src/app/dashboard/component/user/user-computing-unit/user-computing-unit.component.spec.ts
@@ -21,7 +21,9 @@ import { NO_ERRORS_SCHEMA } from "@angular/core";
import { ComponentFixture, TestBed } from "@angular/core/testing";
import { UserComputingUnitComponent } from "./user-computing-unit.component";
import { NzCardModule } from "ng-zorro-antd/card";
+import { NzIconModule } from "ng-zorro-antd/icon";
import { NzModalService } from "ng-zorro-antd/modal";
+import { FileAddOutline } from "@ant-design/icons-angular/icons";
import { HttpClient } from "@angular/common/http";
import { UserService } from "../../../../common/service/user/user.service";
import { StubUserService } from
"../../../../common/service/user/stub-user.service";
@@ -48,7 +50,6 @@ describe("UserComputingUnitComponent", () => {
);
await TestBed.configureTestingModule({
- declarations: [UserComputingUnitComponent],
providers: [
NzModalService,
HttpClient,
@@ -57,7 +58,7 @@ describe("UserComputingUnitComponent", () => {
{ provide: ComputingUnitStatusService, useClass:
MockComputingUnitStatusService },
...commonTestProviders,
],
- imports: [NzCardModule],
+ imports: [UserComputingUnitComponent, NzCardModule,
NzIconModule.forChild([FileAddOutline])],
schemas: [NO_ERRORS_SCHEMA],
}).compileComponents();
diff --git
a/frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/user-dataset-file-renderer/user-dataset-file-renderer.component.spec.ts
b/frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/user-dataset-file-renderer/user-dataset-file-renderer.component.spec.ts
index 6c9cf69ba5..9e70a444df 100644
---
a/frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/user-dataset-file-renderer/user-dataset-file-renderer.component.spec.ts
+++
b/frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/user-dataset-file-renderer/user-dataset-file-renderer.component.spec.ts
@@ -30,8 +30,7 @@ describe("UserDatasetFileRendererComponent", () => {
beforeEach(() => {
TestBed.configureTestingModule({
- imports: [HttpClientTestingModule],
- declarations: [UserDatasetFileRendererComponent],
+ imports: [UserDatasetFileRendererComponent, HttpClientTestingModule],
providers: [
DatasetService,
NotificationService,
diff --git
a/frontend/src/app/dashboard/component/user/user-icon/user-icon.component.spec.ts
b/frontend/src/app/dashboard/component/user/user-icon/user-icon.component.spec.ts
index 881904b47d..11731e0cf6 100644
---
a/frontend/src/app/dashboard/component/user/user-icon/user-icon.component.spec.ts
+++
b/frontend/src/app/dashboard/component/user/user-icon/user-icon.component.spec.ts
@@ -18,7 +18,7 @@
*/
import { NO_ERRORS_SCHEMA } from "@angular/core";
-import { ComponentFixture, TestBed, waitForAsync } from
"@angular/core/testing";
+import { ComponentFixture, TestBed } from "@angular/core/testing";
import { UserIconComponent } from "./user-icon.component";
import { UserService } from "../../../../common/service/user/user.service";
import { HttpClientTestingModule } from "@angular/common/http/testing";
@@ -32,18 +32,18 @@ describe("UserIconComponent", () => {
let component: UserIconComponent;
let fixture: ComponentFixture<UserIconComponent>;
- beforeEach(waitForAsync(() => {
- TestBed.configureTestingModule({
- declarations: [UserIconComponent],
+ beforeEach(async () => {
+ await TestBed.configureTestingModule({
providers: [{ provide: UserService, useClass: StubUserService },
...commonTestProviders],
imports: [
+ UserIconComponent,
RouterTestingModule.withRoutes([{ path: "home", component:
AboutComponent }]),
HttpClientTestingModule,
NzDropDownModule,
],
schemas: [NO_ERRORS_SCHEMA],
}).compileComponents();
- }));
+ });
beforeEach(() => {
fixture = TestBed.createComponent(UserIconComponent);
diff --git
a/frontend/src/app/dashboard/component/user/user-quota/user-quota.component.spec.ts
b/frontend/src/app/dashboard/component/user/user-quota/user-quota.component.spec.ts
index 4ce2c276c3..0d30eb7031 100644
---
a/frontend/src/app/dashboard/component/user/user-quota/user-quota.component.spec.ts
+++
b/frontend/src/app/dashboard/component/user/user-quota/user-quota.component.spec.ts
@@ -43,9 +43,8 @@ describe("UserQuotaComponent", () => {
mockUserQuotaService.getExecutionQuota.mockReturnValue(of([]));
TestBed.configureTestingModule({
- declarations: [UserQuotaComponent],
providers: [{ provide: UserQuotaService, useValue: mockUserQuotaService
}, ...commonTestProviders],
- imports: [HttpClientTestingModule],
+ imports: [UserQuotaComponent, HttpClientTestingModule],
schemas: [NO_ERRORS_SCHEMA],
});
diff --git a/frontend/src/app/hub/component/about/about.component.spec.ts
b/frontend/src/app/hub/component/about/about.component.spec.ts
index 3391ebf186..1666394b06 100644
--- a/frontend/src/app/hub/component/about/about.component.spec.ts
+++ b/frontend/src/app/hub/component/about/about.component.spec.ts
@@ -30,7 +30,7 @@ describe("AboutComponent", () => {
beforeEach(() => {
TestBed.configureTestingModule({
- declarations: [AboutComponent],
+ imports: [AboutComponent],
providers: [{ provide: UserService, useClass: StubUserService },
...commonTestProviders],
});
fixture = TestBed.createComponent(AboutComponent);
diff --git
a/frontend/src/app/hub/component/browse-section/browse-section.component.spec.ts
b/frontend/src/app/hub/component/browse-section/browse-section.component.spec.ts
index d1bfb5036a..a4c91b4abe 100644
---
a/frontend/src/app/hub/component/browse-section/browse-section.component.spec.ts
+++
b/frontend/src/app/hub/component/browse-section/browse-section.component.spec.ts
@@ -30,7 +30,7 @@ describe("BrowseSectionComponent", () => {
beforeEach(() => {
TestBed.configureTestingModule({
- declarations: [BrowseSectionComponent],
+ imports: [BrowseSectionComponent],
providers: [
{ provide: WorkflowPersistService, useValue: {} },
{ provide: DatasetService, useValue: {} },
diff --git
a/frontend/src/app/workspace/component/menu/coeditor-user-icon/coeditor-user-icon.component.spec.ts
b/frontend/src/app/workspace/component/menu/coeditor-user-icon/coeditor-user-icon.component.spec.ts
index badeb3d48b..96568516f3 100644
---
a/frontend/src/app/workspace/component/menu/coeditor-user-icon/coeditor-user-icon.component.spec.ts
+++
b/frontend/src/app/workspace/component/menu/coeditor-user-icon/coeditor-user-icon.component.spec.ts
@@ -17,7 +17,7 @@
* under the License.
*/
-import { ComponentFixture, TestBed, waitForAsync } from
"@angular/core/testing";
+import { ComponentFixture, TestBed } from "@angular/core/testing";
import { CoeditorUserIconComponent } from "./coeditor-user-icon.component";
import { CoeditorPresenceService } from
"../../../service/workflow-graph/model/coeditor-presence.service";
@@ -25,6 +25,8 @@ import { WorkflowActionService } from
"../../../service/workflow-graph/model/wor
import { HttpClient } from "@angular/common/http";
import { HttpClientTestingModule } from "@angular/common/http/testing";
import { NzDropdownMenuComponent, NzDropDownModule } from
"ng-zorro-antd/dropdown";
+import { StubUserService } from
"../../../../common/service/user/stub-user.service";
+import { UserService } from "../../../../common/service/user/user.service";
import { commonTestProviders } from "../../../../common/testing/test-utils";
describe("CoeditorUserIconComponent", () => {
@@ -32,19 +34,19 @@ describe("CoeditorUserIconComponent", () => {
let fixture: ComponentFixture<CoeditorUserIconComponent>;
let coeditorPresenceService: CoeditorPresenceService;
- beforeEach(waitForAsync(() => {
- TestBed.configureTestingModule({
- imports: [HttpClientTestingModule, NzDropDownModule],
- declarations: [CoeditorUserIconComponent],
+ beforeEach(async () => {
+ await TestBed.configureTestingModule({
+ imports: [CoeditorUserIconComponent, HttpClientTestingModule,
NzDropDownModule],
providers: [
WorkflowActionService,
CoeditorPresenceService,
HttpClient,
NzDropdownMenuComponent,
+ { provide: UserService, useClass: StubUserService },
...commonTestProviders,
],
}).compileComponents();
- }));
+ });
beforeEach(() => {
fixture = TestBed.createComponent(CoeditorUserIconComponent);
diff --git
a/frontend/src/app/workspace/service/workflow-graph/model/coeditor-presence.service.spec.ts
b/frontend/src/app/workspace/service/workflow-graph/model/coeditor-presence.service.spec.ts
index d13f316ba3..b524abe6d7 100644
---
a/frontend/src/app/workspace/service/workflow-graph/model/coeditor-presence.service.spec.ts
+++
b/frontend/src/app/workspace/service/workflow-graph/model/coeditor-presence.service.spec.ts
@@ -25,6 +25,8 @@ import { NzDropdownMenuComponent, NzDropDownModule } from
"ng-zorro-antd/dropdow
import { CoeditorUserIconComponent } from
"../../../component/menu/coeditor-user-icon/coeditor-user-icon.component";
import { WorkflowActionService } from "./workflow-action.service";
import { HttpClient } from "@angular/common/http";
+import { StubUserService } from
"../../../../common/service/user/stub-user.service";
+import { UserService } from "../../../../common/service/user/user.service";
import { commonTestProviders } from "../../../../common/testing/test-utils";
describe("CoeditorPresenceService", () => {
@@ -39,6 +41,7 @@ describe("CoeditorPresenceService", () => {
CoeditorPresenceService,
HttpClient,
NzDropdownMenuComponent,
+ { provide: UserService, useClass: StubUserService },
...commonTestProviders,
],
});
diff --git a/frontend/src/tsconfig.spec.json b/frontend/src/tsconfig.spec.json
index 67092ce613..56f023c8ba 100644
--- a/frontend/src/tsconfig.spec.json
+++ b/frontend/src/tsconfig.spec.json
@@ -32,19 +32,9 @@
"**/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",
@@ -55,7 +45,6 @@
"**/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",