Skip to content

Commit

Permalink
chore: #1997 update marketplace url on Authentication page (redirect …
Browse files Browse the repository at this point in the history
…button)
  • Loading branch information
undefined committed Jul 12, 2020
1 parent cd721af commit 6baf016
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,10 @@ describe('Authentication', () => {
})
describe('onMarketplaceButtonClick', () => {
it('should run correctly', () => {
const fn = onMarketplaceButtonClick(history)
fn()
expect(history.replace).toBeCalledWith(Routes.CLIENT)
jest.spyOn(window, 'open')
onMarketplaceButtonClick()
expect(window.open).toBeCalledWith(window.reapit.config.marketplaceUrl, '_self')
;(window.open as jest.Mock).mockReset()
})
})
describe('onRegisterButtonClick', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@ export const onRegisterButtonClick = (history: History) => {
}
}

export const onMarketplaceButtonClick = (history: History) => {
return () => {
history.replace(Routes.CLIENT)
}
export const onMarketplaceButtonClick = () => {
window.open(window.reapit.config.marketplaceUrl, '_self')
}

export const onLogoutButtonClick = (dispatch: Dispatch) => {
Expand Down Expand Up @@ -77,7 +75,7 @@ export const renderDeveloperModal = (history, dispatch) => {
footerItems={
<>
<Button onClick={onRegisterButtonClick(history)}>Register</Button>
<Button onClick={onMarketplaceButtonClick(history)}>Marketplace</Button>
<Button onClick={onMarketplaceButtonClick}>Marketplace</Button>
<Button onClick={onLogoutButtonClick(dispatch)}>Logout</Button>
</>
}
Expand Down

0 comments on commit 6baf016

Please sign in to comment.