import {test, expect} from '../../fixtures/test' // Scroll snap creates smooth, paginated scroll containers — used in horizontal // image carousels, slide-like course content, and step-by-step tutorials. // overscroll-behavior controls pull-to-refresh and bounce effects at edges. // Text content must be preserved regardless of TinyMCE's handling of these. test.describe('CSS scroll-snap and overscroll-behavior properties', () => { test.beforeEach(async ({page, rcePage}) => { await page.goto('/scenarios/basic') await rcePage.waitForEditor() }) async function setAndGet(page: any, html: string): Promise { return page.evaluate((content: string) => { // @ts-expect-error -- TinyMCE global window.tinymce.activeEditor.setContent(content) // @ts-expect-error -- TinyMCE global return window.tinymce.activeEditor.getContent() }, html) } test('scroll-snap-type on container — child text preserved', async ({page}) => { const content = await setAndGet( page, '
Slide One content
Slide Two content
', ) expect(content).toContain('Slide One content') expect(content).toContain('Slide Two content') }) test('scroll-snap-align: center — text preserved', async ({page}) => { const content = await setAndGet( page, '

Center snapping paragraph

', ) expect(content).toContain('Center snapping paragraph') }) test('scroll-snap-stop: always — text preserved', async ({page}) => { const content = await setAndGet( page, '
Required stop slide
', ) expect(content).toContain('Required stop slide') }) test('overscroll-behavior: contain — text preserved', async ({page}) => { const content = await setAndGet( page, '

Contained scroll content

More content here

', ) expect(content).toContain('Contained scroll content') expect(content).toContain('More content here') }) test('overscroll-behavior: none — text preserved', async ({page}) => { const content = await setAndGet( page, '
No overscroll text content
', ) expect(content).toContain('No overscroll text content') }) })