import {test, expect} from '../../fixtures/test' // Headings are in the Blocks select button (bespoke dropdown in toolbar) const blocksSelect = '.tox-toolbar__primary .tox-tbtn--bespoke[aria-label="Blocks"]' async function applyBlock(page: any, blockName: string) { await page.locator(blocksSelect).click() await page.locator(`.tox-collection__item:has-text("${blockName}")`).click() } test.describe('heading blocks', () => { test.beforeEach(async ({page, rcePage}) => { await page.goto('/scenarios/basic') await rcePage.waitForEditor() await rcePage.contentFrame().locator('body').click() }) test('Heading 2 wraps line in
', async ({page, rcePage}) => { await page.keyboard.type('Normal text') await applyBlock(page, 'Heading 2') await applyBlock(page, 'Paragraph') const content = await rcePage.getContent() expect(content).toMatch(/
Normal text<\/p>/) expect(content).not.toMatch(/