add test for empty p tag

This commit is contained in:
Bill Richardson 2024-09-20 15:39:02 -04:00
parent f554ad4d47
commit 2e687c5245

View file

@ -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);
});
});
});