mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 21:27:20 +00:00
fix(editor): format text in code block (#10575)
Closes: [BS-2724](https://linear.app/affine-design/issue/BS-2724/code-block%E9%87%8C%E4%B8%8D%E5%BA%94%E8%AF%A5%E6%98%BE%E7%A4%BAtoolbar)
This commit is contained in:
@@ -597,7 +597,21 @@ test('format text in code block', async ({ page }, testInfo) => {
|
||||
await type(page, 'https://www.baidu.com');
|
||||
await pressEnter(page);
|
||||
|
||||
expect(await line.innerText()).toBe('const aaa = 1000;');
|
||||
const linkLocator = page.locator('[data-block-id="3"] affine-link a');
|
||||
expect(await linkLocator.count()).toBe(3);
|
||||
await expect(linkLocator.nth(0)).toHaveAttribute(
|
||||
'href',
|
||||
'https://www.baidu.com'
|
||||
);
|
||||
await expect(linkLocator.nth(1)).toHaveAttribute(
|
||||
'href',
|
||||
'https://www.baidu.com'
|
||||
);
|
||||
await expect(linkLocator.nth(2)).toHaveAttribute(
|
||||
'href',
|
||||
'https://www.baidu.com'
|
||||
);
|
||||
|
||||
expect(await getPageSnapshot(page, true)).toMatchSnapshot(
|
||||
`${testInfo.title}_link.json`
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user