Skip to content

Commit

Permalink
extend icon tests, testing custom sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
tujoworker committed Jan 23, 2019
1 parent 5d8765a commit 6888b5c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/dnb-ui-lib/src/components/icon/__tests__/Icon.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,17 @@ describe('Icon component', () => {
expect(elem.props().height).toBe(height)
})

it('should work with custom size', () => {
const Comp = mount(<Component {...props} size="100" />)
expect(
Comp.find('span.dnb-icon').hasClass('dnb-icon--custom-size')
).toBe(true)
Comp.setProps({ size: 16 })
expect(
Comp.find('span.dnb-icon').hasClass('dnb-icon--custom-size')
).toBe(false)
})

it('should validate with ARIA rules', async () => {
const Comp = mount(<Component {...props} />)
expect(await axeComponent(Comp)).toHaveNoViolations()
Expand Down

0 comments on commit 6888b5c

Please sign in to comment.