feat(review): remove species picker; species stays from Measure

Species is chosen on the merged Measure screen; the Review select was a
duplicate. Keep species_id on the slab from createSlab (Capture→draft→Woo)
and gate Create title from the hydrated value without offering edit.
This commit is contained in:
grokbot_ty
2026-09-26 08:47:40 -07:00
parent 89bc7d4ee9
commit 610b0883fe
6 changed files with 28 additions and 30 deletions
+4
View File
@@ -20,6 +20,8 @@ export interface SeedMeasure {
sqft: number;
bdft: number;
widthIn: number;
/** Woo species leaf; required for Review-ready e2e now that Review has no species picker. */
speciesId?: number | null;
}
const toEighths = (inches: number) => Math.round(inches * 8);
@@ -58,6 +60,7 @@ export async function seedMeasureDraft(
axisBbox: null,
lengthEighths: payload.lengthEighths,
thicknessEighths: payload.thicknessEighths,
species_id: payload.speciesId ?? null,
results: {
lengthEighths: payload.lengthEighths,
thicknessEighths: payload.thicknessEighths,
@@ -97,6 +100,7 @@ export async function seedMeasureDraft(
widthEighths,
sqft: d.sqft,
bdft: d.bdft,
speciesId: d.speciesId ?? null,
},
);
}
+3 -1
View File
@@ -294,6 +294,7 @@ async function reachReview(page: Page) {
await page.goto('/?noload');
await seedMeasureDraft(page, {
sku: '', lengthIn: 48, thicknessIn: 2, sqft: 6.25, bdft: 12.5, widthIn: 11,
speciesId: SPECIES_ID,
});
// Phase 2: reload WITHOUT ?noload so onMount probes IDB and shows Resume.
await page.goto('/');
@@ -309,7 +310,8 @@ async function reachReview(page: Page) {
/** Fill every ready-gating field to make the slab publishable. */
async function completeForReady(page: Page) {
await page.getByTestId('species').selectOption(String(SPECIES_ID));
// Species comes from Measure/createSlab (seeded on the draft); no Review picker.
await expect(page.getByTestId('species')).toHaveCount(0);
// Wood categories: open, select Live edge, Done.
await page.getByTestId('wood-cat-btn').click();
await page.getByTestId(`wood-cat-opt-${LIVEEDGE_ID}`).click();
@@ -165,7 +165,10 @@ async function mockApi(page: Page) {
async function reachReview(page: Page) {
await page.goto('/?noload');
await seedMeasureDraft(page, { sku: '', lengthIn: 48, thicknessIn: 2, sqft: 6.25, bdft: 12.5, widthIn: 11 });
await seedMeasureDraft(page, {
sku: '', lengthIn: 48, thicknessIn: 2, sqft: 6.25, bdft: 12.5, widthIn: 11,
speciesId: SPECIES_ID,
});
await page.goto('/');
await expect(page.getByRole('heading', { name: 'Resume?' })).toBeVisible({ timeout: 15000 });
await page.getByRole('button', { name: 'Continue' }).click();
@@ -175,7 +178,8 @@ async function reachReview(page: Page) {
}
async function completeForReady(page: Page) {
await page.getByTestId('species').selectOption(String(SPECIES_ID));
// Species comes from Measure/createSlab (seeded on the draft); no Review picker.
await expect(page.getByTestId('species')).toHaveCount(0);
await page.getByTestId('wood-cat-btn').click();
await page.getByTestId(`wood-cat-opt-${LIVEEDGE_ID}`).click();
await page.getByTestId('wood-cat-done').click();