Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
feat(labs): adds labs sidebar/navbar links
Browse files Browse the repository at this point in the history
  • Loading branch information
jackcmeyer committed Apr 3, 2020
1 parent 1867543 commit 691572b
Show file tree
Hide file tree
Showing 4 changed files with 376 additions and 133 deletions.
30 changes: 30 additions & 0 deletions src/__tests__/components/Navbar.test.tsx
Expand Up @@ -85,6 +85,36 @@ describe('Navbar', () => {
})
})

describe('labs', () => {
const labsLinkList = hospitalRunNavbar.find('.labs-link-list')

it('should render a labs dropdown', () => {
expect(labsLinkList.first().props().title).toEqual('labs.label')
expect(labsLinkList.first().props().children[0].props.children).toEqual('labs.label')
expect(labsLinkList.first().props().children[1].props.children).toEqual('labs.requests.new')
})

it('should navigate to to /labs when the labs list option is selected', () => {
act(() => {
labsLinkList
.first()
.props()
.children[0].props.onClick()
})
expect(history.location.pathname).toEqual('/labs')
})

it('should navigate to /labs/new when the new labs list option is selected', () => {
act(() => {
labsLinkList
.first()
.props()
.children[1].props.onClick()
})
expect(history.location.pathname).toEqual('/labs/new')
})
})

describe('search', () => {
const navSearch = hospitalRunNavbar.find('.nav-search')

Expand Down

0 comments on commit 691572b

Please sign in to comment.