/** * 01-reconstitution-calculator.spec.ts * * What: Smoke-tests the Peptide Reconstitution Calculator (PRC) plugin. * Verifies the shortcode renders, presets load, and basic math produces * a non-zero result — catching broken PHP, failed asset enqueue, or * missing PR Core integration. * Who triggers it: Playwright chromium project (post-auth setup). * Dependencies: peptide-reconstitution-calculator plugin active, [prc_calculator] * shortcode on the page at CALC_PAGE_PATH. * * @see C:\Users\ongte\apps\Peptide Repo CTO\app-maps\peptide-reconstitution-calculator.md */ import { test, expect } from '@playwright/test'; const CALC_PATH = process.env.CALC_PAGE_PATH ?? '/calculator/'; test.describe('Reconstitution Calculator', () => { test.beforeEach(async ({ page }) => { const res = await page.goto(CALC_PATH); // Tolerate 200 or 301 (redirect to trailing slash) expect([200, 301]).toContain(res?.status()); await page.waitForLoadState('networkidle'); }); test('shortcode widget renders on page', async ({ page }) => { // The shortcode wraps the widget in a container with class prc-calculator // or similar; at minimum a