Skip to content

Conversation

@agatha197
Copy link
Contributor

@agatha197 agatha197 commented Sep 30, 2025

Add tests for useInterval and useIntervalValue hooks

This PR adds comprehensive test coverage for the useInterval and useIntervalValue hooks. The tests verify:

  • Proper execution of callbacks at specified intervals
  • Pausing functionality when a window loses focus (pauseOnWindowBlur parameter)
  • Resuming execution when a window regains focus
  • Proper handling of null delay values

The PR also includes a minor CSS class update in the DomainSelector snapshot test.

How to test

run pnpm run test in the react directory.

Checklist:

  • Test case(s) to demonstrate the difference of before/after

Copy link
Contributor Author

agatha197 commented Sep 30, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • flow:merge-queue - adds this PR to the back of the merge queue
  • flow:hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has required the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions
Copy link

github-actions bot commented Sep 30, 2025

Coverage report for ./react

St.
Category Percentage Covered / Total
🔴 Statements
4.7% (+0.28% 🔼)
533/11351
🔴 Branches
3.78% (+0.22% 🔼)
303/8016
🔴 Functions
2.92% (+0.37% 🔼)
103/3532
🔴 Lines
4.65% (+0.26% 🔼)
516/11095

Test suite run success

121 tests passing in 14 suites.

Report generated by 🧪jest coverage report action from f3b23e6

@agatha197 agatha197 force-pushed the feat_FR-1530_/add-test-code branch from 422f9d2 to 74cc01d Compare September 30, 2025 06:27
@agatha197 agatha197 force-pushed the feat_FR-1530_/window-focus-check-for-automatic-refresh-interval branch from 63d1fed to 3ecb178 Compare September 30, 2025 06:27
@agatha197 agatha197 force-pushed the feat_FR-1530_/add-test-code branch from 74cc01d to 28a40b4 Compare September 30, 2025 06:32
@agatha197 agatha197 force-pushed the feat_FR-1530_/window-focus-check-for-automatic-refresh-interval branch from 3ecb178 to 837266f Compare September 30, 2025 06:32
@agatha197 agatha197 marked this pull request as draft September 30, 2025 06:39
@agatha197 agatha197 changed the base branch from feat_FR-1530_/window-focus-check-for-automatic-refresh-interval to graphite-base/4371 September 30, 2025 06:48
@agatha197 agatha197 force-pushed the feat_FR-1530_/add-test-code branch from 28a40b4 to 8c0883b Compare September 30, 2025 06:48
@agatha197 agatha197 changed the base branch from graphite-base/4371 to feat_FR-1530_/window-focus-check-for-automatic-refresh-interval September 30, 2025 06:49
@agatha197 agatha197 force-pushed the feat_FR-1530_/window-focus-check-for-automatic-refresh-interval branch from 9c43d1d to 4e1ef17 Compare September 30, 2025 06:57
@agatha197 agatha197 force-pushed the feat_FR-1530_/add-test-code branch from 8c0883b to 5e150d0 Compare September 30, 2025 06:57
@agatha197 agatha197 marked this pull request as ready for review September 30, 2025 06:58
@agatha197 agatha197 changed the base branch from feat_FR-1530_/window-focus-check-for-automatic-refresh-interval to graphite-base/4371 September 30, 2025 07:36
@yomybaby yomybaby force-pushed the feat_FR-1530_/add-test-code branch from 5e150d0 to f7cbbe3 Compare October 1, 2025 08:11
@yomybaby yomybaby force-pushed the graphite-base/4371 branch from 4e1ef17 to 874597a Compare October 1, 2025 08:11
@yomybaby yomybaby changed the base branch from graphite-base/4371 to feat_FR-1530_/window-focus-check-for-automatic-refresh-interval October 1, 2025 08:11
@yomybaby yomybaby force-pushed the feat_FR-1530_/add-test-code branch from f7cbbe3 to 727f503 Compare October 1, 2025 08:13
Copy link
Member

@yomybaby yomybaby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@graphite-app
Copy link

graphite-app bot commented Oct 1, 2025

Merge activity

…ode snapshot (#4371)

# Add tests for useInterval and useIntervalValue hooks

This PR adds comprehensive test coverage for the `useInterval` and `useIntervalValue` hooks. The tests verify:

- Proper execution of callbacks at specified intervals
- Pausing functionality when a window loses focus (`pauseOnWindowBlur` parameter)
- Resuming execution when a window regains focus
- Proper handling of null delay values

The PR also includes a minor CSS class update in the DomainSelector snapshot test.

### How to test
run `pnpm run test` in the react directory.

**Checklist:**

- [x] Test case(s) to demonstrate the difference of before/after
@graphite-app graphite-app bot force-pushed the feat_FR-1530_/window-focus-check-for-automatic-refresh-interval branch from 874597a to a737f11 Compare October 1, 2025 08:14
@graphite-app graphite-app bot force-pushed the feat_FR-1530_/add-test-code branch from 727f503 to f3b23e6 Compare October 1, 2025 08:15
Base automatically changed from feat_FR-1530_/window-focus-check-for-automatic-refresh-interval to main October 1, 2025 08:16
@graphite-app graphite-app bot merged commit f3b23e6 into main Oct 1, 2025
8 checks passed
@graphite-app graphite-app bot deleted the feat_FR-1530_/add-test-code branch October 1, 2025 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100~500 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants