Skip to content
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

<SideDrawer> testing with React Router #251

Merged
merged 3 commits into from Jul 8, 2022

Conversation

oogali
Copy link
Contributor

@oogali oogali commented Jul 8, 2022

Unit test for <SideDrawer> interaction with hash parameters provided via React Router.

It no longer tries to reach directly into the browser for location but relies on what's provided/mapped by React Router via useLocation.

Fixes #249.

@netlify
Copy link

netlify bot commented Jul 8, 2022

Deploy Preview for bldrs-share ready!

Name Link
🔨 Latest commit 957327b
🔍 Latest deploy log https://app.netlify.com/sites/bldrs-share/deploys/62c84e469978cb0008ea7d7f
😎 Deploy Preview https://deploy-preview-251--bldrs-share.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.


useEffect(() => {
const issueHash = getHashParams(window.location, 'i')
const issueHash = getHashParams(location, 'i')
Copy link
Member

Choose a reason for hiding this comment

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

@oogali nice!

// expect(screen.getByText('BLDRS-LOCAL_MODE-ID:1257156364')).toBeInTheDocument()
// })
const {getByText} = render(
<MemoryRouter initialEntries={['/v/p/index.ifc#i:1257156364::c:-26.91,28.84,112.47,-22,16.21,-3.48']}>
Copy link
Member

Choose a reason for hiding this comment

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

@oogali oogali merged commit a9f1a49 into bldrs-ai:main Jul 8, 2022
@oogali oogali deleted the render-with-react-router branch July 10, 2022 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Completed
Development

Successfully merging this pull request may close these issues.

Test SideDrawer reaction to hash params for issues and props.
2 participants