Skip to content

Commit f28becf

Browse files
committed
fix: keep line_2 field optional on touch
1 parent a74ad58 commit f28becf

5 files changed

Lines changed: 9 additions & 4 deletions

File tree

components/composite/StepCustomer/AddressInputGroup/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,15 @@ interface Props {
2828
type: BaseInputType
2929
fieldName: AddressInputName | AddressCountrySelectName | "email"
3030
resource: ResourceErrorType
31+
required?: boolean
3132
value?: string
3233
openShippingAddress?: (props: ShippingToggleProps) => void
3334
}
3435

3536
export const AddressInputGroup: React.FC<Props> = ({
3637
fieldName,
3738
resource,
39+
required,
3840
type,
3941
value,
4042
openShippingAddress,
@@ -150,6 +152,7 @@ export const AddressInputGroup: React.FC<Props> = ({
150152
<>
151153
<StyledAddressInput
152154
id={fieldName}
155+
required={required}
153156
data-test-id={`input_${fieldName}`}
154157
name={fieldName as AddressInputName}
155158
type={type}

components/composite/StepCustomer/BillingAddressFormNew/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export const BillingAddressFormNew: React.FC<Props> = ({
4949
<AddressInputGroup
5050
fieldName="billing_address_line_2"
5151
resource="billing_address"
52+
required={false}
5253
type="text"
5354
value={billingAddress?.line_2 || ""}
5455
/>

components/composite/StepCustomer/ShippingAddressFormNew/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export const ShippingAddressFormNew: React.FC<Props> = ({
4040
<AddressInputGroup
4141
fieldName="shipping_address_line_2"
4242
resource="shipping_address"
43+
required={false}
4344
type="text"
4445
value={shippingAddress?.line_2 || ""}
4546
/>

playwright.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const config: PlaywrightTestConfig = {
4646
// Configure the browser to use.
4747
browserName: "chromium",
4848
// Any Chromium-specific options.
49-
viewport: { width: 1200, height: 800 },
49+
viewport: { width: 1200, height: 900 },
5050
baseURL: process.env.NEXT_PUBLIC_BASE_URL,
5151
launchOptions: {
5252
// logger: {

specs/e2e/guest-addresses.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ test.describe("with customer email", () => {
7070
await checkoutPage.checkButton({ type: "Customer", status: "enabled" })
7171
})
7272

73-
test.skip("line_2 optional attribute on billing address", async ({
73+
test("line_2 optional attribute on billing address", async ({
7474
checkoutPage,
7575
}) => {
7676
await checkoutPage.checkOrderSummary("Order Summary")
@@ -97,7 +97,7 @@ test.describe("with customer email", () => {
9797
await checkoutPage.checkBillingAddress({ ...euAddress, line_2: "" })
9898
})
9999

100-
test.skip("line_2 optional attribute on shipping address", async ({
100+
test("line_2 optional attribute on shipping address", async ({
101101
checkoutPage,
102102
}) => {
103103
await checkoutPage.checkOrderSummary("Order Summary")
@@ -123,7 +123,7 @@ test.describe("with customer email", () => {
123123

124124
await checkoutPage.clickStep("Customer")
125125

126-
await checkoutPage.checkBillingAddress({ ...euAddress, line_2: "" })
126+
await checkoutPage.checkShippingAddress({ ...euAddress2, line_2: "" })
127127
})
128128
})
129129

0 commit comments

Comments
 (0)