add test for empty p tag
This commit is contained in:
parent
f554ad4d47
commit
2e687c5245
1 changed files with 17 additions and 6 deletions
|
|
@ -74,12 +74,23 @@ describe('text-helper', () => {
|
|||
])('formatAmountInDollars(%s) should return %s', (amount, expected) => {
|
||||
expect(formatAmountInDollars(amount)).toBe(expected);
|
||||
});
|
||||
test('returns orderedlist from paragraph string', () => {
|
||||
// Arrange
|
||||
const testData = '<p>String one</p><p>String two</p>';
|
||||
const expected = '<ol><li>String one</li><li>String two</li></ol>';
|
||||
describe('createOrderedListFromStringOfParagraphs', () => {
|
||||
test('returns orderedlist from paragraph string', () => {
|
||||
// Arrange
|
||||
const testData = '<p>String one</p><p>String two</p>';
|
||||
const expected = '<ol><li>String one</li><li>String two</li></ol>';
|
||||
|
||||
// Assert
|
||||
expect(createOrderedListFromStringOfParagraphs(testData)).toBe(expected);
|
||||
// Assert
|
||||
expect(createOrderedListFromStringOfParagraphs(testData)).toBe(expected);
|
||||
});
|
||||
|
||||
test('returns orderedlist from paragraph string with empty <p> tag', () => {
|
||||
// Arrange
|
||||
const testData = '<p>String one</p><p>String two</p><p></p>';
|
||||
const expected = '<ol><li>String one</li><li>String two</li></ol>';
|
||||
|
||||
// Assert
|
||||
expect(createOrderedListFromStringOfParagraphs(testData)).toBe(expected);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue