text content survives round-trip', async ({page}) => {
const content = await setAndGet(page, '
')
expect(content).toContain('Simple div text')
})
test('multiple sibling
s all preserve their text', async ({page}) => {
const content = await setAndGet(
page,
'
First block
Second block
Third block
',
)
expect(content).toContain('First block')
expect(content).toContain('Second block')
expect(content).toContain('Third block')
})
test('
with inline styles preserves text', async ({page}) => {
const content = await setAndGet(
page,
'
Styled div
',
)
expect(content).toContain('Styled div')
})
test('
with class attribute — text preserved', async ({page}) => {
const content = await setAndGet(page, '
Callout text
')
expect(content).toContain('Callout text')
})
test('nested
s preserve inner text', async ({page}) => {
const content = await setAndGet(page, '
')
expect(content).toContain('Deeply nested text')
})
test('
containing
children survives', async ({page}) => {
const content = await setAndGet(
page,
'
Paragraph inside div
Another paragraph
',
)
expect(content).toContain('Paragraph inside div')
expect(content).toContain('Another paragraph')
})
test('
with id attribute — text preserved', async ({page}) => {
const content = await setAndGet(
page,
'
',
)
expect(content).toContain('Introduction content')
})
test('
mixing inline and block children preserves all text', async ({page}) => {
const content = await setAndGet(
page,
'
Bold label: inline textBlock paragraph
',
)
expect(content).toContain('Bold label')
expect(content).toContain('inline text')
expect(content).toContain('Block paragraph')
})
})