Initial commit
This commit is contained in:
commit
7878e653a0
253 changed files with 24552 additions and 0 deletions
15
src/components/General/Utilities/TextLimit.test.tsx
Normal file
15
src/components/General/Utilities/TextLimit.test.tsx
Normal file
|
@ -0,0 +1,15 @@
|
|||
import React from 'react';
|
||||
import { mount } from '../../../tests/enzyme';
|
||||
import TextLimit from './TextLimit';
|
||||
|
||||
describe('Text Limit', () => {
|
||||
it('doesnt cut text until it exceeds the character limit', () => {
|
||||
const wrapper = mount(<TextLimit characters={4}>Text</TextLimit>);
|
||||
expect(wrapper.text()).toEqual('Text');
|
||||
});
|
||||
|
||||
it('cuts off text that exceeds the character limit', () => {
|
||||
const wrapper = mount(<TextLimit characters={6}>Longer text</TextLimit>);
|
||||
expect(wrapper.text()).toEqual('Longer…');
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue