Skip to content

Commit 6e59c21

Browse files
committed
fix(dashboard): Make postalCode required to match Angular parity
Angular's select-address-dialog uses Validators.required on postalCode. Updated the address form schema to match and added postalCode fill to the e2e test.
1 parent e2f304a commit 6e59c21

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

packages/dashboard/e2e/tests/sales/orders.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@ test.describe('Orders', () => {
367367
// Fill the inline address form
368368
await popover.getByLabel('Street Address').fill('99 Inline Road');
369369
await popover.getByLabel('City').fill('Inlineton');
370+
await popover.getByLabel('Postal Code').fill('12345');
370371
// Country is a Select — open and pick the first available country
371372
await popover.getByRole('combobox').click();
372373
await page.getByRole('option').first().click();

packages/dashboard/src/lib/components/shared/customer-address-form.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const addressFormSchema = z.object({
3434
streetLine2: z.string().optional(),
3535
city: z.string().min(1, { message: 'City is required' }),
3636
province: z.string().optional(),
37-
postalCode: z.string().optional(),
37+
postalCode: z.string().min(1, { message: 'Postal code is required' }),
3838
countryCode: z.string().min(1, { message: 'Country is required' }),
3939
phoneNumber: z.string().optional(),
4040
defaultShippingAddress: z.boolean(),

0 commit comments

Comments
 (0)