Skip to content

Commit

Permalink
fix LoginAwareButton tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jay-hodgson committed Oct 15, 2024
1 parent e1ee0cd commit a96d1e8
Showing 1 changed file with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { ApplicationSessionManager } from '../../utils'
import { MemoryRouter } from 'react-router-dom'
import SynapseClient from '../../synapse-client'
import { MOCK_ACCESS_TOKEN } from '../../mocks/MockSynapseContext'
import { createWrapper } from '../../testutils/TestingLibraryUtils'

const defaultProps: LoginAwareButtonProps = {
children: 'Register for this Challenge',
Expand All @@ -18,15 +19,16 @@ const toProps: LoginAwareButtonProps = {
}

function renderComponent(props: LoginAwareButtonProps = defaultProps) {
return render(<LoginAwareButton {...props} />, {
wrapper: ({ children }) => {
return (
<MemoryRouter>
<ApplicationSessionManager>{children}</ApplicationSessionManager>
</MemoryRouter>
)
return render(
<MemoryRouter>
<ApplicationSessionManager>
<LoginAwareButton {...props} />
</ApplicationSessionManager>
</MemoryRouter>,
{
wrapper: createWrapper(),
},
})
)
}

describe('LoginAwareButton tests', () => {
Expand Down

0 comments on commit a96d1e8

Please sign in to comment.