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.
21 lines
682 B
21 lines
682 B
import React from 'react'
|
|
import renderer from 'react-test-renderer'
|
|
import { Truncate } from 'components/UI'
|
|
|
|
describe('component.UI.Truncate', () => {
|
|
it('should truncate text to 12 chars by default', () => {
|
|
const tree = renderer
|
|
.create(<Truncate text="Lorem ipsum dolor sit amet, consectetur adipiscing elit" />)
|
|
.toJSON()
|
|
expect(tree).toMatchSnapshot()
|
|
})
|
|
|
|
it('should truncate test to a specific length when the maxlen parm is provided', () => {
|
|
const tree = renderer
|
|
.create(
|
|
<Truncate text="Lorem ipsum dolor sit amet, consectetur adipiscing elit" maxlen={30} />
|
|
)
|
|
.toJSON()
|
|
expect(tree).toMatchSnapshot()
|
|
})
|
|
})
|
|
|