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


##########
frontend/src/app/dashboard/component/user/user-quota/user-quota.component.spec.ts:
##########
@@ -258,4 +259,94 @@ describe("UserQuotaComponent", () => {
       expect(gd.layout.yaxis.title).toMatchObject({ text: "Y Label" });
     });
   });
+  /**
+   * The Result Cache tab is template-only: the suite above drives the 
component's data and charts
+   * and never renders this tab, so the per-execution row — including the size 
it reports and the id
+   * its delete button carries — was unexercised.
+   */
+  describe("result cache tab", () => {
+    /** Selects a tab by its title and returns the host element. */
+    function openTab(title: string): HTMLElement {
+      const host = fixture.nativeElement as HTMLElement;
+      const tab = 
Array.from(host.querySelectorAll<HTMLElement>(".ant-tabs-tab")).find(t =>
+        (t.textContent || "").includes(title)
+      );
+      tab!.click();
+      fixture.detectChanges();
+      return host;

Review Comment:
   `openTab` uses a non-null assertion (`tab!`), so a missing/renamed tab will 
fail with a generic 'cannot read properties of undefined' instead of a clear 
test failure. Add an explicit guard with an actionable error message.
   
   This issue also appears on line 281 of the same file.



##########
frontend/src/app/dashboard/component/user/user-quota/user-quota.component.spec.ts:
##########
@@ -23,6 +23,7 @@ import { UserQuotaService } from 
"../../../service/user/quota/user-quota.service
 import { HttpClientTestingModule } from "@angular/common/http/testing";
 import { commonTestProviders } from "../../../../common/testing/test-utils";
 import { of } from "rxjs";
+import { By } from "@angular/platform-browser";
 import type { Mocked } from "vitest";
 import { ExecutionQuota } from "../../../../common/type/user";
 import { DatasetQuota } from "../../../type/quota-statistic.interface";

Review Comment:
   Type-only helpers added for the Result Cache tests would be more 
maintainable if they used the existing `WorkflowQuota` type instead of `any` 
(and add the missing import). Using `any` here can mask shape mismatches 
between the fixture and the component/template.
   
   This issue also appears in the following locations of the same file:
   - line 289
   - line 300



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