You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
744 B
26 lines
744 B
import React from 'react'
|
|
import assert from 'assert'
|
|
import { shallow } from 'enzyme'
|
|
import HexToDecimal from '../hex-to-decimal.component'
|
|
|
|
describe('HexToDecimal Component', () => {
|
|
it('should render a prefixed hex as a decimal with a className', () => {
|
|
const wrapper = shallow(<HexToDecimal
|
|
value="0x3039"
|
|
className="hex-to-decimal"
|
|
/>)
|
|
|
|
assert.ok(wrapper.hasClass('hex-to-decimal'))
|
|
assert.equal(wrapper.text(), '12345')
|
|
})
|
|
|
|
it('should render an unprefixed hex as a decimal with a className', () => {
|
|
const wrapper = shallow(<HexToDecimal
|
|
value="1A85"
|
|
className="hex-to-decimal"
|
|
/>)
|
|
|
|
assert.ok(wrapper.hasClass('hex-to-decimal'))
|
|
assert.equal(wrapper.text(), '6789')
|
|
})
|
|
})
|
|
|