Copilot commented on code in PR #7426:
URL: https://github.com/apache/texera/pull/7426#discussion_r3740566168
##########
frontend/src/app/dashboard/component/admin/settings/admin-settings.component.spec.ts:
##########
@@ -419,3 +420,236 @@ describe("AdminSettingsComponent", () => {
});
});
});
+/**
+ * The settings form is four near-identical Save/Reset cards, three
near-identical upload blocks and
+ * twelve switches whose keys include two confusable singular/plural pairs
(workflow_enabled vs
+ * workflows_enabled, dataset_enabled vs datasets_enabled). Cross-wiring from
copy-paste is the
+ * realistic defect here, and the suite above never renders an interaction, so
none of it was pinned.
+ */
+describe("AdminSettingsComponent wiring", () => {
+ let component: AdminSettingsComponent;
+ let fixture: ComponentFixture<AdminSettingsComponent>;
+ let http: HttpTestingController;
+
+ /** Sidebar switches in the order the template renders them. */
+ const SWITCH_KEYS = [
+ "hub_enabled",
+ "home_enabled",
+ "workflow_enabled",
+ "dataset_enabled",
+ "your_work_enabled",
+ "projects_enabled",
+ "workflows_enabled",
+ "datasets_enabled",
+ "compute_enabled",
+ "quota_enabled",
+ "forum_enabled",
+ "about_enabled",
+ ] as const;
+
+ /** Numeric inputs in the order the template renders them. */
+ const NUMBER_FIELDS = [
+ "maxConcurrentFiles",
+ "maxFileSizeMiB",
+ "maxConcurrentChunks",
+ "chunkSizeMiB",
+ "csvMaxColumns",
+ ] as const;
+
+ beforeEach(async () => {
+ TestBed.resetTestingModule();
+ await TestBed.configureTestingModule({
+ imports: [AdminSettingsComponent, HttpClientTestingModule, NzCardModule],
+ }).compileComponents();
+
+ http = TestBed.inject(HttpTestingController);
+ fixture = TestBed.createComponent(AdminSettingsComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ // ngOnInit loads the settings; answer it so the form starts from a known
state.
+ http.expectOne("/api/config/settings").flush({});
+ fixture.detectChanges();
+ });
Review Comment:
This wiring suite injects `HttpTestingController` but never drains the
`nz-icon` asset requests nor calls `verify()`. In this component, `nz-icon` can
trigger additional `assets/*` HTTP requests (the earlier tests in this same
file already account for that), and skipping `verify()` can hide unexpected
network calls and leave pending requests that make future tests flaky.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]