Skip to content

Commit

Permalink
Update src/text-area-word-count/index.spec.jsx
Browse files Browse the repository at this point in the history
Co-authored-by: Jeff Horton <[email protected]>
  • Loading branch information
1 parent cfcb424 commit 15fd32f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/text-area-word-count/index.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe('<WordCountHintMessage />', () => {
});

test('displays remaining words when wordCount is less than maxWordCount', () => {
const wrapper = shallow(<WordCountHintMessage content='This is a sentence with 8 words' maxWordCount={10} id={id} />);
const wrapper = shallow(<WordCountHintMessage content='This is a sentence with 7 words' maxWordCount={10} id={id} />);
expect(wrapper.find(wordCountHintId).text()).toContain('You have 3 words remaining');
});

Expand All @@ -23,17 +23,17 @@ describe('<WordCountHintMessage />', () => {
});

test('displays too many words when wordCount is greater than maxWordCount', () => {
const wrapper = shallow(<WordCountHintMessage content='This is a sentence with 10 words - 2 more plus 2' maxWordCount={10} id={id} />);
const wrapper = shallow(<WordCountHintMessage content='This is a sentence with 12 words - 2 more plus 2' maxWordCount={10} id={id} />);
expect(wrapper.find(wordCountHintId).text()).toContain('You have 2 words too many');
});

test('displays singular word when there is only one word remaining', () => {
const wrapper = shallow(<WordCountHintMessage content='This is a sentence with 10 words i think' maxWordCount={10} id={id} />);
const wrapper = shallow(<WordCountHintMessage content='This is a sentence with 9 words i think' maxWordCount={10} id={id} />);
expect(wrapper.find(wordCountHintId).text()).toContain('You have 1 word remaining');
});

test('displays singular word when there is only one word too many', () => {
const wrapper = shallow(<WordCountHintMessage content='This is a sentence with 10 words - 3 more words' maxWordCount={10} id={id} />);
const wrapper = shallow(<WordCountHintMessage content='This is a sentence with 11 words - 3 more words' maxWordCount={10} id={id} />);
expect(wrapper.find(wordCountHintId).text()).toContain('You have 1 word too many');
});
});

0 comments on commit 15fd32f

Please sign in to comment.