Skip to content

test(mobile): add missing SSR environment tests#346

Merged
kimyouknow merged 6 commits intotoss:mainfrom
eunwoo-levi:test/add-ssr-tests-mobile-hooks
Mar 18, 2026
Merged

test(mobile): add missing SSR environment tests#346
kimyouknow merged 6 commits intotoss:mainfrom
eunwoo-levi:test/add-ssr-tests-mobile-hooks

Conversation

@eunwoo-levi
Copy link
Contributor

@eunwoo-levi eunwoo-levi commented Mar 12, 2026

Overview

Problem

4 hooks in @react-simplikit/mobile were missing .ssr.test.ts files, which are required by the
project's contributing guidelines for all hooks that access browser APIs.

Solution

Add SSR environment tests (@vitest-environment node) for the 4 hooks, following the same pattern
as the existing SSR tests.

Hooks added in this PR

  • useNetworkStatus
  • usePageVisibility
  • useAvoidKeyboard
  • useKeyboardHeight

Additional Fix

  • Found that @vitest/coverage-v8 was missing from @react-simplikit/mobile devDependencies,
    while the coverage config already existed in vitest.config.ts. Added the missing dependency.

Checklist

  • Did you write the test code?
  • Have you run yarn run fix to format and lint the code and docs?
  • Have you run yarn run test:coverage to make sure there is no uncovered line?
  • Did you write the JSDoc?

eunwoo-levi and others added 4 commits March 13, 2026 05:07
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Collaborator

@kimyouknow kimyouknow left a comment

Choose a reason for hiding this comment

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

Thanks for adding SSR tests for the mobile hooks!

@kimyouknow kimyouknow merged commit e4a5335 into toss:main Mar 18, 2026
11 checks passed
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.

2 participants