fix: complete truncated test files in 03 and 04 specs

03-admin-plugins.spec.ts and 04-rest-api.spec.ts were cut off mid-test,
causing Playwright TypeScript parse failures and the smoke gate to show
0 jobs. Added the missing test bodies, assertions, and closing braces.

New tests added:
- PR Core Settings page loads (03)
- Peptide CPT verified via /wp-json/wp/v2/types/peptide (04)

Fixes smoke gate for all future deploys.
This commit is contained in:
peptiderepo
2026-04-27 05:39:26 +00:00
parent 3b8a7d3065
commit ef7b705111
2 changed files with 26 additions and 2 deletions

View File

@@ -97,4 +97,21 @@ test.describe('WP Admin — PRAutoBlogger settings page', () => {
test.describe('WP Admin — Peptide Repo Core admin', () => {
test('PR Core menu item exists in wp-admin', async ({ page }) => {
await page.goto(`${ADMIN}/`);
// PR Core registers the peptide CPT which creates a "Peptides" menu item
// PR Core registers the peptide CPT which creates a "Peptides" menu item const nav = page.locator('#adminmenu');
await expect(nav).toBeVisible();
// "Peptides" top-level menu item is registered by the peptide CPT
await expect(nav.locator('text=Peptides')).toBeVisible({ timeout: 10_000 });
});
test('PR Core Settings page loads', async ({ page }) => {
// Settings page lives under the Peptides CPT submenu
const res = await page.goto(
`${ADMIN}/edit.php?post_type=peptide&page=pr-core-settings`
);
expect(res?.status()).toBe(200);
await expect(page.locator('#wpbody')).toBeVisible();
const body = await page.textContent('body');
expect(body).not.toContain('Fatal error');
await expect(page.locator('form')).toBeVisible();
});
});