From 0f7243f4d9f00eed95c6cede61eea7370fc16123 Mon Sep 17 00:00:00 2001 From: Shubhanker Srivastava Date: Thu, 9 May 2024 15:57:35 +0530 Subject: [PATCH] add test --- .../__tests__/e2e/AutoLinks.spec.mjs | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/packages/lexical-playground/__tests__/e2e/AutoLinks.spec.mjs b/packages/lexical-playground/__tests__/e2e/AutoLinks.spec.mjs index 916b1bfc644..b13e2e4a70a 100644 --- a/packages/lexical-playground/__tests__/e2e/AutoLinks.spec.mjs +++ b/packages/lexical-playground/__tests__/e2e/AutoLinks.spec.mjs @@ -331,4 +331,55 @@ test.describe('Auto Links', () => { {ignoreClasses: true}, ); }); + + test('Can convert url-like text with styles into links', async ({ + page, + isPlainText, + }) => { + test.skip(isPlainText); + await focusEditor(page); + + //increase font size + await click(page, '.font-increment'); + await click(page, '.font-increment'); + + await page.keyboard.type('Hellohttp://example.com and more'); + + await assertHTML( + page, + html` +

+ + Hellohttp://example.com and more + +

+ `, + undefined, + {ignoreClasses: true}, + ); + + // Add space before link text + await moveToLineBeginning(page); + await moveRight(page, 5); + await page.keyboard.type(' '); + + await assertHTML( + page, + html` +

+ Hello + + + http://example.com + + + + and more + +

+ `, + undefined, + {ignoreClasses: true}, + ); + }); });