mengw15 commented on code in PR #7655:
URL: https://github.com/apache/texera/pull/7655#discussion_r3780864316


##########
frontend/src/app/dashboard/component/admin/user/admin-user.component.spec.ts:
##########
@@ -611,4 +612,155 @@ describe("AdminUserComponent", () => {
       expect(component.filterByRole([], mk({ role: Role.ADMIN }))).toBe(false);
     });
   });
+
+  /**
+   * The tests above call the component's methods; these drive the table 
itself — the
+   * per-column search dropdowns, the click-to-edit cells and the row actions 
— so a control
+   * that loses its handler fails here.
+   */
+  describe("rendered table", () => {
+    /** Seeds both lists, as loading the users does, and renders the rows. */
+    function renderUsers(users: User[]): void {
+      component.userList = [...users];
+      component.listOfDisplayUser = [...users];
+      fixture.detectChanges();
+    }
+
+    const rowNames = (): string[] =>
+      Array.from(fixture.nativeElement.querySelectorAll("tbody tr")).map(row =>
+        ((row as HTMLElement).querySelectorAll("td")[2]?.textContent ?? 
"").trim()
+      );

Review Comment:
   Both applied.
   
   `rowNames` was left over from three column-filter tests I dropped before 
opening this PR (the dropdown menu never renders under jsdom — the PR 
description lists what I tried). Removed.
   
   The Enter assertion was indeed indistinguishable from the `focusout` that 
followed it; the name cell's flow already split them, email and comment did 
not. Each binding now has its own assertion with a `mockClear()` between. 
Verified the fix isn't cosmetic: deleting `(keydown.enter)` from the email 
input now fails the spec, where before the same mutation still passed.



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