import {test, expect} from '../../fixtures/test' // Ordered lists support type (1/a/A/i/I), start (begin numbering at N), and // reversed attributes. These appear in course outlines, legal citations, and // multi-part problem sets where numbering continuity matters across page edits. test.describe('ordered list type, start, and reversed attributes', () => { 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('ol type="a" lowercase alpha — list items preserved', async ({page}) => { const content = await setAndGet( page, '
  1. First option
  2. Second option
  3. Third option
', ) expect(content).toContain('First option') expect(content).toContain('Third option') }) test('ol type="A" uppercase alpha — list items preserved', async ({page}) => { const content = await setAndGet( page, '
  1. Option Alpha
  2. Option Bravo
', ) expect(content).toContain('Option Alpha') expect(content).toContain('Option Bravo') }) test('ol type="i" lowercase roman — list items preserved', async ({page}) => { const content = await setAndGet( page, '
  1. Part one
  2. Part two
  3. Part three
', ) expect(content).toContain('Part one') expect(content).toContain('Part three') }) test('ol type="I" uppercase roman — list items preserved', async ({page}) => { const content = await setAndGet( page, '
  1. Chapter I content
  2. Chapter II content
', ) expect(content).toContain('Chapter I content') expect(content).toContain('Chapter II content') }) test('ol start="5" — items preserved', async ({page}) => { const content = await setAndGet( page, '
  1. Fifth item
  2. Sixth item
', ) expect(content).toContain('Fifth item') expect(content).toContain('Sixth item') }) test('ol start="3" type="a" — combined attributes, items preserved', async ({page}) => { const content = await setAndGet( page, '
  1. Continued from c
  2. Next item d
', ) expect(content).toContain('Continued from c') expect(content).toContain('Next item d') }) test('nested ol with different types — all items preserved', async ({page}) => { const content = await setAndGet( page, '
  1. Roman one
    1. Alpha sub-item
    2. Beta sub-item
  2. Roman two
', ) expect(content).toContain('Roman one') expect(content).toContain('Alpha sub-item') expect(content).toContain('Roman two') }) })