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,6 +74,7 @@ describe('text-helper', () => {
|
||||||
])('formatAmountInDollars(%s) should return %s', (amount, expected) => {
|
])('formatAmountInDollars(%s) should return %s', (amount, expected) => {
|
||||||
expect(formatAmountInDollars(amount)).toBe(expected);
|
expect(formatAmountInDollars(amount)).toBe(expected);
|
||||||
});
|
});
|
||||||
|
describe('createOrderedListFromStringOfParagraphs', () => {
|
||||||
test('returns orderedlist from paragraph string', () => {
|
test('returns orderedlist from paragraph string', () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const testData = '<p>String one</p><p>String two</p>';
|
const testData = '<p>String one</p><p>String two</p>';
|
||||||
|
|
@ -82,4 +83,14 @@ describe('text-helper', () => {
|
||||||
// Assert
|
// Assert
|
||||||
expect(createOrderedListFromStringOfParagraphs(testData)).toBe(expected);
|
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