Skip to content

Commit

Permalink
fix test so this doesn't happen again :)
Browse files Browse the repository at this point in the history
  • Loading branch information
Emily Plummer committed Mar 2, 2021
1 parent 5386b34 commit fdb10f6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/__tests__/TabNav.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import {TabNav} from '..'
import {mount, render, rendersClass, behavesAsComponent, checkExports} from '../utils/testing'
import {render, behavesAsComponent, checkExports} from '../utils/testing'
import {COMMON} from '../constants'
import {render as HTMLRender, cleanup} from '@testing-library/react'
import {axe, toHaveNoViolations} from 'jest-axe'
Expand All @@ -19,13 +19,15 @@ describe('TabNav', () => {
})

it('should have no axe violations', async () => {
const {container} = HTMLRender(<TabNav />)
const {container} = HTMLRender(<TabNav aria-label="main" />)
const results = await axe(container)
expect(results).toHaveNoViolations()
cleanup()
})

it('sets aria-label appropriately', () => {
expect(render(<TabNav aria-label="foo" />).props['aria-label']).toEqual('foo')
const {getByLabelText} = HTMLRender(<TabNav aria-label="stuff"/>)
expect(getByLabelText("stuff")).toBeTruthy();
expect(getByLabelText("stuff").tagName).toEqual("NAV")
})
})

0 comments on commit fdb10f6

Please sign in to comment.