Skip to content

P1B: Refactor (packages/app/e2e/performance/timeline/session-tab-switch-metrics.ts:43): Complex binary expression - #86

Open
halammari wants to merge 2 commits into
CMU-17313Q:mainfrom
halammari:refactor-session-tab-switch-metrics
Open

halammari wants to merge 2 commits into
CMU-17313Q:mainfrom
halammari:refactor-session-tab-switch-metrics

Conversation

@halammari

@halammari halammari commented Sep 5, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #79

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

This PR refactors by splitting the complex condition in 'isCorrectDestination' into separate checks to make it easier to follow. I also moved the bottom-anchor check into a small helper function. The existing tests still pass after the change.

If you paste a large clearly AI generated description here your PR may be IGNORED or CLOSED!

How did you verify your code works?

  • Ran bun test ./e2e/performance/unit/session-tab-switch-metrics.test.ts and 5 tests passed, 0 failed.
  • Ran the coverage test for the same file: 5 tests passed, 0 failed; the refactored file has 93.33% function coverage and 95.00% line coverage.
  • Ran qlty smells --no-snippets packages/app/e2e/performance/timeline/session-tab-switch-metrics.ts and the Complex binary expression issue is no longer reported.

Screenshots / recordings

No UI change.
bfr qlty
qlty
after-qlty
bun test
coverage test
bun lint
passing test

  • Before Qlty: Complex binary expression reported at line 43.
  • After Qlty: Complex binary expression is no longer reported for the refactored file.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

If you do not follow this template your PR will be automatically rejected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

P1B: Refactor (packages/app/e2e/performance/timeline/session-tab-switch-metrics.ts:43): Complex binary expression

1 participant