Skip to content

Commit

Permalink
chore: test reorder #1932
Browse files Browse the repository at this point in the history
  • Loading branch information
marek-mihok committed Oct 25, 2023
1 parent 0efb494 commit 0d163ef
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions ui/src/nav.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,18 @@ describe('Nav.tsx', () => {
expect(pushMock).toHaveBeenCalledTimes(0)
})

it('Does not set args and calls sync when link is opened in a new window', () => {
const pushMock = jest.fn()
const { getByTitle } = render(<View {...navProps} />)

wave.push = pushMock

fireEvent.click(getByTitle('Nav 1'), { ctrlKey: true, metaKey: true })

expect(wave.args['nav1']).toBeUndefined()
expect(pushMock).not.toHaveBeenCalled()
})

it('Sets window location hash when name starts with hash', () => {
const { getByTitle } = render(<View {...navPropsHash} />)
fireEvent.click(getByTitle('Nav 1'))
Expand Down Expand Up @@ -145,18 +157,6 @@ describe('Nav.tsx', () => {
expect(windowOpenMock).toHaveBeenCalled()
})

it('Does not set args when link is opened in a new window', () => {
const pushMock = jest.fn()
const { getByTitle } = render(<View {...navProps} />)

wave.push = pushMock

fireEvent.click(getByTitle('Nav 1'), { ctrlKey: true, metaKey: true })

expect(wave.args['nav1']).not.toBe(true)
expect(pushMock).not.toHaveBeenCalled()
})

describe('Value update', () => {
it('Sets args on value update', () => {
const props: T.Model<State> = { ...navProps, state: { items } }
Expand Down

0 comments on commit 0d163ef

Please sign in to comment.