fix(review): carry Measure species into Create title/short-desc

Live overnight slabs after removing the Review species picker had
species_id null, so Create title stayed gated off. Require species on
Measure Calculate, stop the select sync from wiping choices before
options load, and have Review gate/PUT from slab.species_id with a
Capture handoff repair so deterministic title/short-desc always see it.
This commit is contained in:
grokbot_ty
2026-09-26 08:57:53 -07:00
parent 610b0883fe
commit 76f30262f3
7 changed files with 151 additions and 27 deletions
+5
View File
@@ -324,6 +324,8 @@ async function completeForReady(page: Page) {
await page.getByTestId('create-title').click();
// Wait for the build to complete (title field populated = deterministic copy).
await expect(page.getByTestId('title')).not.toHaveValue('');
await expect(page.getByTestId('title')).toHaveValue(/Cedar/);
await expect(page.getByTestId('short-desc')).toHaveValue(/Cedar/);
await page.getByTestId('sku').fill('SLAB-0001');
// SKU commits on blur — press Tab to move focus off it (deterministic, single
// commit; a body click can re-focus the SKU and re-fire blur).
@@ -339,9 +341,12 @@ test.describe('M3 Review→Publish flow (#77)', () => {
await expect(page.getByTestId('ready-status')).toContainText(/Not ready|Ready/);
await expect(page.getByTestId('title')).toHaveValue('');
await completeForReady(page);
// Species from Measure draft must land on the slab (Create title reads it).
expect(slab.species_id).toBe(SPECIES_ID);
// #89: the Create build populated the deterministic copy on the slab row.
expect(slab.title).toBeTruthy();
expect(slab.short_description).toBeTruthy();
expect(String(slab.title)).toMatch(/Cedar/);
// Continue to Publish is enabled and hands off.
await expect(page.getByTestId('continue-publish')).toBeEnabled();
await page.getByTestId('continue-publish').click();