import {test, expect} from '../../fixtures/test' // Nursing and allied health programs use Canvas to distribute clinical content: // patient case studies, medication administration tables, care plan templates, // and clinical procedure checklists. This content often contains structured // tables and formatted lists that must survive the RCE round-trip precisely. test.describe('Canvas nursing and clinical content patterns', () => { 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('patient case study header — demographics and chief complaint preserved', async ({page}) => { const content = await setAndGet( page, `

Case Study: Mrs. R.

Age67SexFemale
Chief complaintShortness of breath and chest tightness for 2 days
PMHType 2 diabetes, hypertension, hyperlipidemia (20 years)
AllergiesPenicillin (hives), sulfa drugs (anaphylaxis)
`, ) expect(content).toContain('Shortness of breath') expect(content).toContain('Type 2 diabetes') expect(content).toContain('anaphylaxis') }) test('medication administration table — drug data preserved', async ({page}) => { const content = await setAndGet( page, `
Current Medications
MedicationDoseRouteFrequencyIndication
Metformin1000 mgPOBID with mealsType 2 DM
Lisinopril10 mgPODailyHTN
Furosemide40 mgPODaily morningFluid retention
`, ) expect(content).toContain('Metformin') expect(content).toContain('BID with meals') expect(content).toContain('Furosemide') expect(content).toContain('Fluid retention') }) test('clinical procedure checklist — all steps preserved', async ({page}) => { const content = await setAndGet( page, `

Foley Catheter Insertion — Sterile Technique

  1. Verify order and confirm patient identity using two identifiers
  2. Explain procedure; ensure privacy and patient consent
  3. Gather supplies: catheter kit, Foley catheter (appropriate size), sterile gloves
  4. Position patient supine; dorsal recumbent for female patients
  5. Open kit using sterile technique; don sterile gloves
  6. Cleanse urethral meatus with provided antiseptic solution
  7. Insert catheter using sterile technique; advance until urine flows
  8. Inflate balloon with sterile water per manufacturer specification
  9. Secure catheter to patient's thigh; connect to closed drainage system
`, ) expect(content).toContain('two identifiers') expect(content).toContain('sterile technique') expect(content).toContain('urethral meatus') expect(content).toContain('closed drainage system') }) test('nursing care plan NANDA diagnosis — text preserved', async ({page}) => { const content = await setAndGet( page, `

Nursing Diagnosis

Problem: Impaired gas exchange related to alveolar-capillary membrane changes secondary to pneumonia, as evidenced by SpO2 88% on room air and use of accessory muscles.

Goal: Patient will maintain SpO2 > 94% on supplemental oxygen within 4 hours of nursing interventions.

Interventions:

`, ) expect(content).toContain('alveolar-capillary membrane') expect(content).toContain('accessory muscles') expect(content).toContain('incentive spirometry') }) })