Skip to content

Commit dc4be52

Browse files
committed
remove unnecessary mocking
1 parent 1832ab8 commit dc4be52

File tree

1 file changed

+8
-22
lines changed
  • packages/extension-chakra-storefront/src/pages/checkout/partials

1 file changed

+8
-22
lines changed

packages/extension-chakra-storefront/src/pages/checkout/partials/payment.jsx

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -28,33 +28,19 @@ import {API_ERROR_MESSAGE} from '../../../constants'
2828
const Payment = () => {
2929
const {formatMessage} = useIntl()
3030
const {data: basket} = useCurrentBasket()
31-
31+
const selectedShippingAddress = basket?.shipments && basket?.shipments[0]?.shippingAddress
3232
//TODO: Change to const after deleting the test/mocked data
33-
let selectedShippingAddress = basket?.shipments && basket?.shipments[0]?.shippingAddress
3433
let selectedBillingAddress = basket?.billingAddress
3534
let appliedPayment = basket?.paymentInstruments && basket?.paymentInstruments[0]
3635

3736
// TODO: Testing/Mock data - remove this section after shipping and billing address components are migrated
38-
const MOCK_DATA = {
39-
shippingAddress: {
40-
address1: '123 Test Street',
41-
city: 'Test City',
42-
stateCode: 'CA',
43-
postalCode: '12345',
44-
countryCode: 'US'
45-
},
46-
billingAddress: {
47-
address1: '123 Test Street',
48-
city: 'Test City',
49-
stateCode: 'CA',
50-
postalCode: '12345',
51-
countryCode: 'US'
52-
}
37+
selectedBillingAddress = {
38+
address1: '123 Test Street',
39+
city: 'Test City',
40+
stateCode: 'CA',
41+
postalCode: '12345',
42+
countryCode: 'US'
5343
}
54-
55-
selectedShippingAddress = MOCK_DATA.shippingAddress
56-
selectedBillingAddress = MOCK_DATA.billingAddress
57-
5844
const [billingSameAsShipping, setBillingSameAsShipping] = useState(true) // By default, have billing addr to be the same as shipping
5945
const {mutateAsync: addPaymentInstrumentToBasket} = useShopperBasketsMutation(
6046
'addPaymentInstrumentToBasket'
@@ -75,7 +61,7 @@ const Payment = () => {
7561

7662
const {step, STEPS, goToStep, goToNextStep} = useCheckout()
7763

78-
// TODO: This is added for testing, remove after shipping address is migrated
64+
// TODO: This is added for testing, remove after shipping and billing address components are migrated
7965
const [isEditing, setIsEditing] = useState(true)
8066

8167
const billingAddressForm = useForm({

0 commit comments

Comments
 (0)