Skip to content

Conversation

@pan-kot
Copy link
Member

@pan-kot pan-kot commented Sep 5, 2025

The currently exported renderWithSingleTabStopNavigation util requires a dependency on the react testing library. To avoid having this dependency, we export TestSingleTabStopNavigationProvider and setTestSingleTabStopNavigationTarget helpers instead. Once components code is migrated, the renderWithSingleTabStopNavigation export will be removed.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@pan-kot pan-kot force-pushed the fix-stsn-testing-helper-export branch from 56fce5e to 5154281 Compare September 5, 2025 11:38
@codecov
Copy link

codecov bot commented Sep 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.33%. Comparing base (1bdc64f) to head (da18a55).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #159      +/-   ##
==========================================
- Coverage   99.42%   99.33%   -0.10%     
==========================================
  Files          35       36       +1     
  Lines         866      898      +32     
  Branches      234      236       +2     
==========================================
+ Hits          861      892      +31     
- Misses          5        6       +1     

☔ 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.

renderWithSingleTabStopNavigation,
TestSingleTabStopNavigationProvider,
getTestSingleTabStopNavigationProvider,
} from './single-tab-stop/__tests__/utils';
Copy link
Member

Choose a reason for hiding this comment

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

This also has to change. We exclude tests directory from the typescript production build:

"exclude": ["**/__tests__/**", "**/__integ__/**"]

Currently you see it working because of some unintended behaviors in the tooling, but this is not expected.

Cross-package code should be moved outside the __tests__ folder in something like test-utils if you would like to maintain a semantic name

/**
* @deprecated - Use TestSingleTabStopNavigationProvider instead
*/
export function renderWithSingleTabStopNavigation(
Copy link
Member

Choose a reason for hiding this comment

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

Can you re-write this test-case to a non-deprecated version to prove that it works?

Copy link
Member Author

Choose a reason for hiding this comment

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

I updated two tests to make sure both the provider and the helper util work as expected. Once components code is migrated, I will remove the renderWithSingleTabStopNavigation and migrate the rest of the tests.

@pan-kot pan-kot force-pushed the fix-stsn-testing-helper-export branch from 5154281 to 9eb4acd Compare September 5, 2025 13:13
@pan-kot pan-kot marked this pull request as ready for review September 5, 2025 13:14
@pan-kot pan-kot requested a review from a team as a code owner September 5, 2025 13:14
@pan-kot pan-kot requested review from just-boris and mariksav and removed request for a team September 5, 2025 13:14
@pan-kot pan-kot force-pushed the fix-stsn-testing-helper-export branch from 9eb4acd to e64cd78 Compare September 5, 2025 13:21
just-boris
just-boris previously approved these changes Sep 5, 2025
Copy link
Member

@just-boris just-boris left a comment

Choose a reason for hiding this comment

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

Looks great, thanks

@pan-kot
Copy link
Member Author

pan-kot commented Sep 5, 2025

@just-boris I updated the exported API a little so instead of getTestSingleTabStopNavigationProvider there is now setTestSingleTabStopNavigationTarget, for simplicity. Could you pls take another quick look?

@pan-kot pan-kot merged commit 15f08d8 into main Sep 5, 2025
37 checks passed
@pan-kot pan-kot deleted the fix-stsn-testing-helper-export branch September 5, 2025 15:01
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