Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
Update the test harnesses for the removed admin seed defaults
Damian Legawiec4658a18493e8
diff --git a/packages/create-spree-app/tests/templates.test.ts b/packages/create-spree-app/tests/templates.test.tsindex 30cb76e166..1e5242abd6 100644--- a/packages/create-spree-app/tests/templates.test.ts+++ b/packages/create-spree-app/tests/templates.test.ts@@ -124,10 +124,14 @@ describe('readmeContent', () => {expect(content).toContain('# my-store')})- it('includes admin credentials', () => {+ // No dummy credentials are seeded any more — the admin account is created+ // during first run, so the README points there instead of printing a+ // well-known email and password.+ it('points at first-run setup instead of printing credentials', () => {const content = readmeContent('my-store', true, 3000)- expect(content).toContain('[email protected]')- expect(content).toContain('spree123')+ expect(content).toContain('admin email and password during the first run')+ expect(content).not.toContain('[email protected]')+ expect(content).not.toContain('spree123')})it('includes storefront section', () => {diff --git a/packages/dashboard/e2e/helpers.ts b/packages/dashboard/e2e/helpers.tsindex 2989d056ed..7b52b56533 100644--- a/packages/dashboard/e2e/helpers.ts+++ b/packages/dashboard/e2e/helpers.ts@@ -169,7 +169,7 @@ export function rowButton(page: Page, name: string) {return page.getByRole('button', { name: new RegExp(`^${escapeRegex(name)}(\\s|$)`) })}-function escapeRegex(s: string) {+export function escapeRegex(s: string) {return s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}diff --git a/packages/dashboard/e2e/roles.spec.ts b/packages/dashboard/e2e/roles.spec.tsindex 7eea2fb88f..959d4e3918 100644--- a/packages/dashboard/e2e/roles.spec.ts+++ b/packages/dashboard/e2e/roles.spec.ts@@ -1,5 +1,5 @@import { expect, type Page, test } from '@playwright/test'-import { login } from './helpers'+import { escapeRegex, login } from './helpers'const ROLES_PATH = (storeId: string) => `/${storeId}/settings/roles`@@ -151,13 +151,12 @@ test.describe('roles', () => {timeout: 15_000,})- // Assign it to the seed admin from the staff page.+ // Assign it to the signed-in admin from the staff page. The email comes+ // from the fixtures rather than a literal — seeds no longer mint a+ // well-known admin, so global-setup creates one and reports its address.+ const adminRow = new RegExp(escapeRegex(creds.admin_email), 'i')await page.goto(`/${creds.store_id}/settings/staff`)- await page- .getByRole('row', { name: /spree@example\.com/i })- .getByRole('button')- .last()- .click()+ await page.getByRole('row', { name: adminRow }).getByRole('button').last().click()await page.getByRole('menuitem', { name: /edit/i }).click()await page.getByRole('checkbox', { name: new RegExp(name, 'i') }).check()await page.getByRole('button', { name: /^save$/i }).click()@@ -172,16 +171,12 @@ test.describe('roles', () => {// Unassign, then delete goes through.await page.goto(`/${creds.store_id}/settings/staff`)- await page- .getByRole('row', { name: /spree@example\.com/i })- .getByRole('button')- .last()- .click()+ await page.getByRole('row', { name: adminRow }).getByRole('button').last().click()await page.getByRole('menuitem', { name: /edit/i }).click()await page.getByRole('checkbox', { name: new RegExp(name, 'i') }).uncheck()await page.getByRole('button', { name: /^save$/i }).click()await expect(- page.getByRole('row', { name: /spree@example\.com/i }).getByText(new RegExp(name, 'i')),+ page.getByRole('row', { name: adminRow }).getByText(new RegExp(name, 'i')),).toHaveCount(0, { timeout: 15_000 })await gotoRoles(page, creds.store_id)diff --git a/packages/sdk/tests/integration/global-setup.ts b/packages/sdk/tests/integration/global-setup.tsindex dc4cee9bc4..be58144627 100644--- a/packages/sdk/tests/integration/global-setup.ts+++ b/packages/sdk/tests/integration/global-setup.ts@@ -16,7 +16,16 @@ const execOpts = {encoding: 'utf-8' as const,timeout: 120_000,maxBuffer: 10 * 1024 * 1024,- env: { ...process.env, RAILS_ENV: 'test', PORT },+ // Seeds only create an admin when both are set — sample data needs one as+ // the import owner, so the harness asks for it explicitly rather than+ // relying on defaults the seed no longer ships.+ env: {+ ...process.env,+ RAILS_ENV: 'test',+ PORT,+ ADMIN_EMAIL: '[email protected]',+ ADMIN_PASSWORD: 'spree123',+ },}const CREDENTIALS_RUBY = [