-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(demo-mode): multi-tour context #88781
Conversation
Codecov ReportAttention: Patch coverage is ✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## master #88781 +/- ##
==========================================
+ Coverage 87.69% 87.76% +0.06%
==========================================
Files 10089 10031 -58
Lines 570583 567241 -3342
Branches 22444 22261 -183
==========================================
- Hits 500396 497820 -2576
+ Misses 69776 68998 -778
- Partials 411 423 +12 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
mockSetState = jest.fn( | ||
(stateOrUpdater: MockToursState | ((prev: MockToursState) => MockToursState)) => { | ||
if (typeof stateOrUpdater === 'function') { | ||
mockState = stateOrUpdater(mockState); | ||
} else { | ||
mockState = stateOrUpdater; | ||
} | ||
return mockState; | ||
} | ||
); | ||
|
||
mockUseLocalStorageState.mockImplementation(() => [mockState, mockSetState]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feels like we could simplify this. i think localstorage is already mocked
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I gave this a shot but wasn't able to get it to easily do what we need here since useLocalStorageState
uses useState
as its primary state storage and also keeps localStorage in sync with a micro task. So we would have to mock both :/
The tests are more hook specific now, so the main problem i had is fixed. But it's a big change so the review kind starts over.
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
Closes TET-81
Introduces a
DemoToursContext
that manages multiple demo tours (Sidebar, Issues, Releases, Performance) with shared state management. Each tour maintains its own progress while using common components described in storybook for state persistence and step navigation.Actual tours will be ported over to this in the followup PRs