mengw15 opened a new pull request, #7967:
URL: https://github.com/apache/texera/pull/7967

   ### What changes were proposed in this PR?
   
   Renders the login card, which the existing 23 `it()` blocks almost never did 
— they
   called `detectChanges()` twice. 13 new tests. Measured locally with
   `--coverage --coverage-reporters=lcovonly`:
   
   | `texera-login.component.html` | Before | After |
   | --- | --- | --- |
   | lines | 44/57 (77.19 %) | **57/57 (100 %)** |
   | branches | 11/24 | **24/24** |
   | handlers | 0/4 | **4/4** |
   
   - **Provider flags** — all four combinations of `localLogin` × 
`googleLogin`, since
     `localLogin` is read twice (the tab strip and the form) and the "or 
continue
     with" divider is gated on both. The all-off case also asserts the brand and
     footer still render, so the card is never blank. Each test sets both flags
     explicitly rather than leaning on the mock's defaults.
   - **Sign-in / sign-up mode** — the tab strip drives `mode` in both 
directions via
     `(nzSelectedIndexChange)`, and `[nzSelectedIndex]` follows `mode` back; 
the two
     sign-up-only input groups (`email`, `confirm`), the password-policy hint 
and the
     submit label are asserted present in sign-up and absent in sign-in.
   - **Password visibility** — the suffix template is shared by both password 
groups,
     so a single toggle has to flip both inputs and both icons. Covered by 
click and
     by `keydown.enter`, plus toggling back.
   - **Form submission** — through the form's `(ngSubmit)` binding rather than 
by
     calling `submit()`.
   
   The icon assertion reads the icon name off `NzIconDirective`'s own field: the
   directive declares `nzType` as a setter with no getter, so reading the input 
back
   yields `undefined`.
   
   No production code was changed.
   
   ### Any related issues, documentation, discussions?
   
   Closes #7962.
   
   ### How was this PR tested?
   
   `ng test --watch=false --include 
src/app/hub/component/login/texera-login.component.spec.ts`
   — 36 passed (23 before, 13 new), repeated 3× for stability. `yarn format:ci` 
clean.
   Failure path verified by breaking one assertion in each of the 13 new tests: 
13
   failed / 23 passed, non-zero exit, then restored to green.
   
   Running the whole `hub/**` folder surfaces one failure in
   `hub-search-result.component.spec.ts` (`setViewMode … persists to 
localStorage`),
   which reproduces on an unmodified checkout of `main` and is unrelated to this
   change.
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Opus 5)
   


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