SLICE-8: Shopify dialect — detect/map Shopify export at the codec boundary + DOC-2/3 (SD-0002 §7.2) #32

Merged
ben.stull merged 11 commits from slice-8-shopify-dialect into main 2026-06-12 09:37:38 +00:00
2 changed files with 37 additions and 0 deletions
Showing only changes of commit 17f3b600fd - Show all commits
+2
View File
@@ -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,<p>Imported from Shopify.</p>,Acme,Drinkware,"mugs",TRUE,active,SM-001,300,25,14.00,20.00,FALSE,Shopify Mug | Acme,7.00
1 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
2 shopify-mug Shopify Mug <p>Imported from Shopify.</p> Acme Drinkware mugs TRUE active SM-001 300 25 14.00 20.00 FALSE Shopify Mug | Acme 7.00
+35
View File
@@ -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();
});