feat: added test from issue

This commit is contained in:
SamTV12345 2025-07-16 21:11:52 +02:00
parent 9409fd4557
commit cb8e7227ba

View file

@ -106,4 +106,37 @@ test.describe('ordered_list.js', function () {
await expect(padBody.locator('div').first().locator('.list-number2')).toHaveCount(1)
});
test('issue 5718 stops numbering OLs after ULs', async function ({page}) {
const padBody = await getPadBody(page);
await clearPadContent(page)
await writeToPad(page, 'Line 1')
await page.keyboard.press('Enter')
await writeToPad(page, 'Line 2')
await page.keyboard.press('Enter')
await writeToPad(page, 'Line 3')
const $insertunorderedlistButton = page.locator('.buttonicon-insertunorderedlist')
const $insertorderedlistButton = page.locator('.buttonicon-insertorderedlist')
const firstLine = padBody.locator('div').nth(7)
const secondLine = padBody.locator('div').nth(8)
const thirdLine = padBody.locator('div').nth(9)
await firstLine.selectText()
await $insertunorderedlistButton.first().click()
await secondLine.selectText()
await $insertorderedlistButton.first().click()
await thirdLine.selectText()
await $insertorderedlistButton.first().click()
expect(await thirdLine.locator('ol').getAttribute('start')).toEqual('3'); // This passes
expect(await thirdLine.locator('ol').getAttribute('class')).toEqual('list-number2'); // This fails
});
});