Skip to content

test(frontend): cover about-page login visibility branches#4894

Merged
bobbai00 merged 2 commits into
apache:mainfrom
bobbai00:test/4879-about-component-login-coverage
May 4, 2026
Merged

test(frontend): cover about-page login visibility branches#4894
bobbai00 merged 2 commits into
apache:mainfrom
bobbai00:test/4879-about-component-login-coverage

Conversation

@bobbai00
Copy link
Copy Markdown
Contributor

@bobbai00 bobbai00 commented May 4, 2026

What changes were proposed in this PR?

Adds 3 unit tests to about.component.spec.ts covering the *ngIf branches in about.component.html that codecov flagged on #4890:

  • <texera-local-login> is hidden when the user is logged in.
  • It is shown when the user is logged out and config.env.localLogin is true.
  • It is hidden when the user is logged out but config.env.localLogin is false.

Provides RouterTestingModule.withRoutes([]) plus a NotificationService spy via useValue so the real LocalLoginComponent renders under TestBed (matching the spy-mocked NotificationService pattern in download.service.spec.ts and workflow-result-export.service.spec.ts).

Any related issues, documentation, discussions?

Sibling of #4890 (the actual /about layout fix). Split out of #4890 because the release branch still uses the old frontend testing framework, and the layout fix needs to backport cleanly without dragging the new spec along. This PR targets main only — no backport.

How was this PR tested?

yarn ng test --watch=false --include=\"src/app/hub/component/about/about.component.spec.ts\" → 4 passed.

Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (claude-opus-4-7)

@github-actions github-actions Bot added the frontend Changes related to the frontend GUI label May 4, 2026
@bobbai00 bobbai00 requested a review from Yicong-Huang May 4, 2026 03:58
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 41.84%. Comparing base (d14b43d) to head (897f429).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #4894      +/-   ##
============================================
- Coverage     42.23%   41.84%   -0.39%     
+ Complexity     2154     2087      -67     
============================================
  Files           954      953       -1     
  Lines         34694    34657      -37     
  Branches       3629     3626       -3     
============================================
- Hits          14653    14503     -150     
- Misses        19138    19209      +71     
- Partials        903      945      +42     
Flag Coverage Δ
frontend 29.97% <ø> (+0.48%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Yicong-Huang
Copy link
Copy Markdown
Contributor

hmm can you make CI happy first?

@bobbai00 bobbai00 force-pushed the test/4879-about-component-login-coverage branch from b570a65 to 2747882 Compare May 4, 2026 04:20
Adds 3 tests covering the *ngIf branches that codecov flagged in
about.component.html:
- hides <texera-local-login> when the user is logged in
- shows it when logged out and config.localLogin is true
- hides it when logged out but config.localLogin is false

Provides RouterTestingModule + a NotificationService spy so the real
LocalLoginComponent can render under TestBed (matching the spy-mocked
NotificationService pattern used elsewhere in the codebase).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@bobbai00 bobbai00 force-pushed the test/4879-about-component-login-coverage branch from 2747882 to f47b015 Compare May 4, 2026 04:20
@bobbai00 bobbai00 enabled auto-merge (squash) May 4, 2026 05:02
@bobbai00 bobbai00 merged commit 3353321 into apache:main May 4, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend Changes related to the frontend GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants