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

Commit

Permalink
test(sidebar.test.tsx): add test to check incidents is rendered last …
Browse files Browse the repository at this point in the history
…in sidebar

#12
  • Loading branch information
emma-r-slight committed Dec 19, 2020
1 parent 3fba22b commit be42c75
Showing 1 changed file with 3 additions and 19 deletions.
22 changes: 3 additions & 19 deletions src/__tests__/shared/components/Sidebar.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -335,26 +335,10 @@ describe('Sidebar', () => {
expect(screen.getByText(/incidents.reports.new/i)).toBeInTheDocument()
})

it.skip('should be the last one in the sidebar', () => {
it('should be the last one in the sidebar', () => {
render('/incidents')

screen.debug(wrapper)
const listItems = wrapper.find(ListItem)
const reportsLabel = listItems.length - 2

expect(listItems.at(reportsLabel).text().trim()).toBe('incidents.reports.label')
expect(
listItems
.at(reportsLabel - 1)
.text()
.trim(),
).toBe('incidents.reports.new')
expect(
listItems
.at(reportsLabel - 2)
.text()
.trim(),
).toBe('incidents.label')
expect(screen.getAllByText(/label/i)[5]).toHaveTextContent(/imagings.label/i)
expect(screen.getAllByText(/label/i)[6]).toHaveTextContent(/incidents.label/i)
})

it('should not render the new incident report link when user does not have the report incidents privileges', () => {
Expand Down

0 comments on commit be42c75

Please sign in to comment.