Copilot commented on code in PR #7408:
URL: https://github.com/apache/texera/pull/7408#discussion_r3739617846


##########
frontend/src/app/hub/component/browse-section/browse-section.component.spec.ts:
##########
@@ -18,6 +18,11 @@
  */
 
 import { ComponentFixture, TestBed } from "@angular/core/testing";
+import { RouterTestingModule } from "@angular/router/testing";
+import { By } from "@angular/platform-browser";
+import { HttpClientTestingModule } from "@angular/common/http/testing";

Review Comment:
   After removing HttpClientTestingModule from the TestBed imports, its 
top-level import should also be removed to avoid dead code in the spec file.
   
   This issue also appears on line 141 of the same file.



##########
frontend/src/app/hub/component/browse-section/browse-section.component.spec.ts:
##########
@@ -122,3 +127,104 @@ describe("BrowseSectionComponent", () => {
     });
   });
 });
+/**
+ * The cards themselves are template-only: the specs above assert the route 
map and the cover-URL
+ * cache, but nothing had ever rendered a card, so the per-entity bindings and 
their fallbacks were
+ * unpinned. RouterTestingModule supplies the Router that the cards' 
routerLink needs.
+ */
+describe("BrowseSectionComponent rendering", () => {
+  let component: BrowseSectionComponent;
+  let fixture: ComponentFixture<BrowseSectionComponent>;
+
+  beforeEach(() => {
+    TestBed.resetTestingModule();
+    TestBed.configureTestingModule({
+      imports: [BrowseSectionComponent, RouterTestingModule.withRoutes([]), 
HttpClientTestingModule],
+      providers: [
+        // The cards embed texera-user-avatar, which injects UserService; the 
real one drags in
+        // AuthService and its whole dependency chain, so the shared stub 
stands in for it.
+        { provide: UserService, useClass: StubUserService },
+        { provide: WorkflowPersistService, useValue: {} },
+        { provide: DatasetService, useValue: {} },
+        { provide: ChangeDetectorRef, useValue: {} },
+        ...commonTestProviders,

Review Comment:
   Providing ChangeDetectorRef as an empty object isn’t necessary (Angular 
provides a real ChangeDetectorRef for components) and can hide future issues if 
the component starts calling cdr methods. Consider removing this provider so 
the test environment stays closer to runtime.
   
   This issue also appears on line 158 of the same file.



-- 
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]

Reply via email to