Skip to content

Commit

Permalink
add Arrow tests
Browse files Browse the repository at this point in the history
  • Loading branch information
estevanmaito committed May 17, 2019
1 parent 611d703 commit 0d92734
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/__tests__/Tooltip/Arrow/Arrow.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import Arrow from '../../../Tooltip/Arrow/Arrow'
import style from '../../../Tooltip/Arrow/style'

describe('Arrow', () => {
const [arrowSize, buttonSize, backgroundColor, icons] = [
5, 10, '#C565A4', { length: 2 }
]
const props = { arrowSize, buttonSize, backgroundColor, icons }

it('should render the tooltip arrow', () => {
const arrow = Arrow(props)

expect(arrow.nodeName).toEqual('DIV')
})

it('should render the arrow with the correct style', () => {
const arrow = Arrow(props)

const expected = document.createElement('div')
expected.style.cssText = style(props)

expect(arrow.style.cssText).toEqual(expected.style.cssText)
})
})

0 comments on commit 0d92734

Please sign in to comment.