Skip to content

6833 - Expand session timeout poller tests - #7370

Open
MagnusG2 wants to merge 1 commit into
rubyforgood:mainfrom
MagnusG2:6833-session-timeout-tests
Open

MagnusG2 wants to merge 1 commit into
rubyforgood:mainfrom
MagnusG2:6833-session-timeout-tests

Conversation

@MagnusG2

Copy link
Copy Markdown

What github issue is this PR for, if any?

Related to #6833

What changed, and why?

  • Added Jest coverage for the two-minute session timeout warning.
  • Added coverage for reloading after the full session timeout has elapsed.
  • Replaced the negative warning threshold used by the previous test with a realistic three-minute timeout.
  • Used Jest fake timers and a Node test environment so window.location.reload can be mocked without jsdom navigation errors.

No production code was changed.

How is this tested?

  • npm run test -- app/javascript/__tests__/two_minute_warning_session_timeout.test.js
    • 3 tests passed.
  • npm run lint -- app/javascript/__tests__/two_minute_warning_session_timeout.test.js
  • npm run test
    • 15 test suites passed.
    • 126 tests passed.

Screenshots please :)

Not applicable — this is a test-only change with no UI changes.

@github-actions github-actions Bot added 🧪 Tests Tests javascript Touches JavaScript code labels Nov 11, 2026

This branch has not been deployed

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

Labels

javascript Touches JavaScript code 🧪 Tests Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant