diff --git a/e2e/fixtures/shopify-export.csv b/e2e/fixtures/shopify-export.csv new file mode 100644 index 0000000..2a3ac4c --- /dev/null +++ b/e2e/fixtures/shopify-export.csv @@ -0,0 +1,2 @@ +Handle,Title,Body (HTML),Vendor,Type,Tags,Published,Status,Variant SKU,Variant Grams,Variant Inventory Qty,Variant Price,Variant Compare At Price,Gift Card,SEO Title,Cost per item +shopify-mug,Shopify Mug,

Imported from Shopify.

,Acme,Drinkware,"mugs",TRUE,active,SM-001,300,25,14.00,20.00,FALSE,Shopify Mug | Acme,7.00 diff --git a/e2e/tests/import-shopify-dialect.spec.ts b/e2e/tests/import-shopify-dialect.spec.ts new file mode 100644 index 0000000..63a7b17 --- /dev/null +++ b/e2e/tests/import-shopify-dialect.spec.ts @@ -0,0 +1,35 @@ +// DoD scenario e2e_import_shopify_dialect (SD-0002 §6.8, SLICE-8): a Shopify +// product CSV imports directly (PUC-6). Upload an unmodified-shape Shopify export; +// the preview recognizes the dialect ("Shopify product CSV — mapped"), lists the +// columns with no canonical home as not-imported, and the import confirms and +// completes — the run report card carrying the same dialect label. +import { expect, test } from "@playwright/test"; +import { gotoProducts, signUpWithStorefront, uploadFixture } from "../helpers"; + +test("e2e_import_shopify_dialect", async ({ page }) => { + await signUpWithStorefront(page); + await gotoProducts(page); + + await uploadFixture(page, "shopify-export.csv"); + + // Preview (§5.4): the file name, the recognized dialect, and the not-imported band. + await expect( + page.getByRole("heading", { name: "Import preview — shopify-export.csv" }), + ).toBeVisible(); + await expect(page.getByText("Shopify product CSV — mapped")).toBeVisible(); + // The not-imported band lists Shopify columns with no canonical home. Assert a + // column that never appears in canonical diff detail, so the match is unambiguous. + await expect(page.getByText("Columns not imported")).toBeVisible(); + await expect(page.getByText("Variant Compare At Price")).toBeVisible(); + await expect(page.getByRole("button", { name: "1 to add" })).toBeVisible(); + await expect(page.getByRole("button", { name: "0 errors" })).toBeVisible(); + + // Consent gate (PUC-3): confirm the import. + await page.getByRole("button", { name: "Import 1 products" }).click(); + + // Run detail (§5.5): report card carries the same dialect label and completes. + await expect(page.getByRole("heading", { level: 1, name: "shopify-export.csv" })).toBeVisible(); + await expect(page.getByText("Shopify product CSV — mapped")).toBeVisible(); + await expect(page.getByText("1 added · 0 updated · 0 rows in error")).toBeVisible(); + await expect(page.getByText("Complete", { exact: true })).toBeVisible(); +});