@shopify/ui-extensions 2025.10.0-rc.45 → 2025.10.0-rc.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/surfaces/checkout/preact/api.js +1 -1
- package/build/cjs/surfaces/checkout/shared.js +1 -1
- package/build/esm/surfaces/checkout/preact/api.mjs +1 -1
- package/build/esm/surfaces/checkout/shared.mjs +1 -1
- package/build/esnext/surfaces/checkout/preact/api.esnext +1 -1
- package/build/esnext/surfaces/checkout/shared.esnext +1 -1
- package/build/ts/docs/shared/components/ConsentCheckbox.d.ts +4 -0
- package/build/ts/docs/shared/components/ConsentCheckbox.d.ts.map +1 -0
- package/build/ts/docs/shared/components/ConsentPhoneField.d.ts +4 -0
- package/build/ts/docs/shared/components/ConsentPhoneField.d.ts.map +1 -0
- package/build/ts/docs/shared/components/index.d.ts +2 -0
- package/build/ts/docs/shared/components/index.d.ts.map +1 -1
- package/build/ts/surfaces/checkout/components/ConsentCheckbox/ConsentCheckbox.doc.d.ts +4 -0
- package/build/ts/surfaces/checkout/components/ConsentCheckbox/ConsentCheckbox.doc.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/ConsentCheckbox.d.ts +84 -0
- package/build/ts/surfaces/checkout/components/ConsentPhoneField/ConsentPhoneField.doc.d.ts +4 -0
- package/build/ts/surfaces/checkout/components/ConsentPhoneField/ConsentPhoneField.doc.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/ConsentPhoneField.d.ts +129 -0
- package/build/ts/surfaces/checkout/components/NumberField/NumberField.doc.d.ts +4 -0
- package/build/ts/surfaces/checkout/components/NumberField/NumberField.doc.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/components/NumberField.d.ts +98 -0
- package/build/ts/surfaces/checkout/components/PasswordField.d.ts +1 -1
- package/build/ts/surfaces/checkout/components/components-shared.d.ts +17 -0
- package/build/ts/surfaces/checkout/components/components.d.ts +216 -144
- package/build/ts/surfaces/checkout/shared.d.ts +1 -1
- package/build/ts/surfaces/checkout/shared.d.ts.map +1 -1
- package/build/ts/surfaces/checkout/targets/Checkout::Actions::RenderBefore.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/Checkout::CartLineDetails::RenderAfter.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/Checkout::CartLineDetails::RenderLineComponents.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/Checkout::CartLines::RenderAfter.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/Checkout::Contact::RenderAfter.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/Checkout::CustomerInformation::RenderAfter.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/Checkout::DeliveryAddress::RenderBefore.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/Checkout::Dynamic::Render.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/Checkout::GiftCard::Render.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/Checkout::PaymentMethod::HostedFields::RenderAfter.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/Checkout::PaymentMethod::Render.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/Checkout::PaymentMethod::RenderRequiredAction.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/Checkout::PickupLocations::RenderAfter.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/Checkout::PickupLocations::RenderBefore.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/Checkout::PickupPoints::RenderAfter.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/Checkout::PickupPoints::RenderBefore.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/Checkout::Reductions::RenderAfter.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/Checkout::Reductions::RenderBefore.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/Checkout::ShippingMethodDetails::RenderAfter.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/Checkout::ShippingMethodDetails::RenderExpanded.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/Checkout::ShippingMethods::RenderAfter.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/Checkout::ShippingMethods::RenderBefore.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/Checkout::ThankYou::CartLineDetails::RenderAfter.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/Checkout::ThankYou::CartLines::RenderAfter.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/Checkout::ThankYou::CustomerInformation::RenderAfter.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/Checkout::ThankYou::Dynamic::Render.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.cart-line-item.line-components.render.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.actions.render-before.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.block.render.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.cart-line-item.render-after.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.cart-line-list.render-after.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.contact.render-after.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.delivery-address.render-after.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.delivery-address.render-before.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.footer.render-after.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.gift-card.render.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.header.render-after.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.payment-method-list.render-after.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.payment-method-list.render-before.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.payment-option-item.action-required.render.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.payment-option-item.details.render.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.payment-option-item.hosted-fields.render-after.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.pickup-location-list.render-after.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.pickup-location-list.render-before.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.pickup-location-option-item.render-after.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.pickup-point-list.render-after.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.pickup-point-list.render-before.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.reductions.render-after.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.reductions.render-before.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.shipping-option-item.details.render.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.shipping-option-item.render-after.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.shipping-option-list.render-after.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.checkout.shipping-option-list.render-before.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.thank-you.announcement.render.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.thank-you.block.render.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.thank-you.cart-line-item.render-after.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.thank-you.cart-line-list.render-after.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.thank-you.customer-information.render-after.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.thank-you.footer.render-after.d.ts +3 -0
- package/build/ts/surfaces/checkout/targets/purchase.thank-you.header.render-after.d.ts +3 -0
- package/build/ts/surfaces/customer-account/components/ConsentCheckbox.d.ts +84 -0
- package/build/ts/surfaces/customer-account/components/ConsentPhoneField.d.ts +129 -0
- package/build/ts/surfaces/customer-account/components/NumberField.d.ts +98 -0
- package/build/ts/surfaces/customer-account/components/PasswordField.d.ts +1 -1
- package/build/ts/surfaces/customer-account/components/components-shared.d.ts +17 -0
- package/build/ts/surfaces/customer-account/components/components.d.ts +216 -144
- package/build/ts/surfaces/customer-account/targets/customer-account.footer.render-after.d.ts +3 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.order-index.announcement.render.d.ts +3 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.order-index.block.render.d.ts +3 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.order-status.announcement.render.d.ts +3 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.order-status.block.render.d.ts +3 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.order-status.cart-line-item.render-after.d.ts +3 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.order-status.cart-line-list.render-after.d.ts +3 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.order-status.customer-information.render-after.d.ts +3 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.order-status.fulfillment-details.render-after.d.ts +3 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.order-status.payment-details.render-after.d.ts +3 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.order-status.return-details.render-after.d.ts +3 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.order-status.unfulfilled-items.render-after.d.ts +3 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.order.action.menu-item.render.d.ts +3 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.order.action.render.d.ts +3 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.order.page.render.d.ts +3 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.page.render.d.ts +3 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.profile.addresses.render-after.d.ts +3 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.profile.announcement.render.d.ts +3 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.profile.block.render.d.ts +3 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.profile.company-details.render-after.d.ts +3 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.profile.company-location-addresses.render-after.d.ts +3 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.profile.company-location-payment.render-after.d.ts +3 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.profile.company-location-staff.render-after.d.ts +3 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.profile.payment.render-after.d.ts +3 -0
- package/build/ts/surfaces/point-of-sale/components/Badge.d.ts +10 -1
- package/build/ts/surfaces/point-of-sale/components/Banner.d.ts +12 -4
- package/build/ts/surfaces/point-of-sale/components/Box.d.ts +51 -14
- package/build/ts/surfaces/point-of-sale/components/Button.d.ts +12 -2
- package/build/ts/surfaces/point-of-sale/components/Choice.d.ts +3 -2
- package/build/ts/surfaces/point-of-sale/components/ChoiceList/ChoiceList.doc.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/components/ChoiceList.d.ts +13 -4
- package/build/ts/surfaces/point-of-sale/components/Clickable.d.ts +11 -4
- package/build/ts/surfaces/point-of-sale/components/DateField/DateField.doc.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/components/DateField.d.ts +20 -13
- package/build/ts/surfaces/point-of-sale/components/DatePicker/DatePicker.doc.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/components/DatePicker.d.ts +16 -4
- package/build/ts/surfaces/point-of-sale/components/DateSpinner/DateSpinner.doc.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/components/DateSpinner.d.ts +16 -4
- package/build/ts/surfaces/point-of-sale/components/Divider/Divider.doc.d.ts +4 -0
- package/build/ts/surfaces/point-of-sale/components/Divider/Divider.doc.d.ts.map +1 -0
- package/build/ts/surfaces/point-of-sale/components/Divider.d.ts +4 -3
- package/build/ts/surfaces/point-of-sale/components/EmailField/EmailField.doc.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/components/EmailField.d.ts +22 -5
- package/build/ts/surfaces/point-of-sale/components/Heading.d.ts +7 -4
- package/build/ts/surfaces/point-of-sale/components/Icon.d.ts +13 -3
- package/build/ts/surfaces/point-of-sale/components/Image.d.ts +12 -5
- package/build/ts/surfaces/point-of-sale/components/Modal.d.ts +28 -7
- package/build/ts/surfaces/point-of-sale/components/NumberField/NumberField.doc.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/components/NumberField.d.ts +32 -23
- package/build/ts/surfaces/point-of-sale/components/Page.d.ts +25 -11
- package/build/ts/surfaces/point-of-sale/components/PosBlock.d.ts +12 -13
- package/build/ts/surfaces/point-of-sale/components/QrCode.d.ts +12 -8
- package/build/ts/surfaces/point-of-sale/components/ScrollBox.d.ts +47 -15
- package/build/ts/surfaces/point-of-sale/components/SearchField/SearchField.doc.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/components/SearchField.d.ts +17 -5
- package/build/ts/surfaces/point-of-sale/components/Section.d.ts +15 -9
- package/build/ts/surfaces/point-of-sale/components/Stack.d.ts +67 -7
- package/build/ts/surfaces/point-of-sale/components/Text.d.ts +25 -4
- package/build/ts/surfaces/point-of-sale/components/TextArea/TextArea.doc.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/components/TextArea.d.ts +22 -5
- package/build/ts/surfaces/point-of-sale/components/TextField/TextField.doc.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/components/TextField.d.ts +22 -5
- package/build/ts/surfaces/point-of-sale/components/Tile.d.ts +12 -2
- package/build/ts/surfaces/point-of-sale/components/TimeField/TimeField.doc.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/components/TimeField.d.ts +18 -6
- package/build/ts/surfaces/point-of-sale/components/TimePicker/TimePicker.doc.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/components/TimePicker.d.ts +16 -4
- package/build/ts/surfaces/point-of-sale/components/components-shared.d.ts +102 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +14 -3
- package/src/docs/shared/components/ConsentCheckbox.ts +12 -0
- package/src/docs/shared/components/ConsentPhoneField.ts +12 -0
- package/src/docs/shared/components/index.ts +2 -0
- package/src/surfaces/checkout/components/ConsentCheckbox/examples/basic-consent-checkbox.example.html +5 -0
- package/src/surfaces/checkout/components/ConsentCheckbox.d.ts +84 -0
- package/src/surfaces/checkout/components/ConsentPhoneField/examples/basic-consent-phone-field.example.html +5 -0
- package/src/surfaces/checkout/components/ConsentPhoneField.d.ts +129 -0
- package/src/surfaces/checkout/components/NumberField/examples/basic-number-field.example.html +8 -0
- package/src/surfaces/checkout/components/NumberField.d.ts +98 -0
- package/src/surfaces/checkout/components/PasswordField.d.ts +1 -1
- package/src/surfaces/checkout/components/PhoneField/examples/basic-phone-field.example.html +2 -1
- package/src/surfaces/checkout/components/ProductThumbnail/examples/basic-product-thumbnail.example.html +4 -1
- package/src/surfaces/checkout/components/Stack/examples/basic-stack.example.html +20 -4
- package/src/surfaces/checkout/components/TextArea/examples/basic-text-area.example.html +5 -1
- package/src/surfaces/checkout/components/TextField/examples/basic-text-field.example.html +4 -1
- package/src/surfaces/checkout/components/components-shared.d.ts +17 -0
- package/src/surfaces/checkout/components/components.d.ts +216 -144
- package/src/surfaces/checkout/preact/api.ts +1 -1
- package/src/surfaces/checkout/preact/tests/api.test.tsx +22 -13
- package/src/surfaces/checkout/preact/tests/app-metafields.test.ts +52 -56
- package/src/surfaces/checkout/preact/tests/attributes.test.ts +34 -24
- package/src/surfaces/checkout/preact/tests/billing-address.test.ts +17 -7
- package/src/surfaces/checkout/preact/tests/buyer-identity-businessCustomer.test.ts +16 -9
- package/src/surfaces/checkout/preact/tests/buyer-identity.test.tsx +57 -26
- package/src/surfaces/checkout/preact/tests/buyer-journey.test.ts +71 -74
- package/src/surfaces/checkout/preact/tests/capabilities.test.ts +32 -28
- package/src/surfaces/checkout/preact/tests/cart-line-target.test.ts +31 -24
- package/src/surfaces/checkout/preact/tests/checkout-settings.test.ts +17 -9
- package/src/surfaces/checkout/preact/tests/checkout-token.test.ts +16 -6
- package/src/surfaces/checkout/preact/tests/configuration.test.ts +16 -6
- package/src/surfaces/checkout/preact/tests/country.test.tsx +18 -8
- package/src/surfaces/checkout/preact/tests/currency.test.tsx +18 -8
- package/src/surfaces/checkout/preact/tests/customer-privacy.test.ts +17 -8
- package/src/surfaces/checkout/preact/tests/delivery-group-list-target.test.ts +24 -18
- package/src/surfaces/checkout/preact/tests/delivery-group-target.test.ts +25 -19
- package/src/surfaces/checkout/preact/tests/delivery-group.test.ts +22 -16
- package/src/surfaces/checkout/preact/tests/delivery-groups.test.ts +17 -11
- package/src/surfaces/checkout/preact/tests/delivery-selection-groups.test.ts +31 -24
- package/src/surfaces/checkout/preact/tests/discounts.test.tsx +21 -14
- package/src/surfaces/checkout/preact/tests/extension-language.test.tsx +17 -8
- package/src/surfaces/checkout/preact/tests/gift-cards.test.tsx +17 -8
- package/src/surfaces/checkout/preact/tests/localized-fields.test.ts +58 -59
- package/src/surfaces/checkout/preact/tests/market.test.tsx +17 -7
- package/src/surfaces/checkout/preact/tests/metafield.test.tsx +33 -36
- package/src/surfaces/checkout/preact/tests/metafields.test.tsx +36 -53
- package/src/surfaces/checkout/preact/tests/mount.tsx +60 -17
- package/src/surfaces/checkout/preact/tests/notes.test.tsx +16 -6
- package/src/surfaces/checkout/preact/tests/payment-method.test.ts +87 -60
- package/src/surfaces/checkout/preact/tests/payment-options.test.tsx +26 -24
- package/src/surfaces/checkout/preact/tests/pickup-location-option-target.test.tsx +55 -46
- package/src/surfaces/checkout/preact/tests/redeemable.test.ts +30 -23
- package/src/surfaces/checkout/preact/tests/session-token.test.tsx +12 -6
- package/src/surfaces/checkout/preact/tests/shipping-address.test.ts +17 -7
- package/src/surfaces/checkout/preact/tests/shipping-option-target.test.ts +54 -50
- package/src/surfaces/checkout/preact/tests/shopping-address.test.tsx +18 -10
- package/src/surfaces/checkout/preact/tests/timezone.test.tsx +17 -7
- package/src/surfaces/checkout/preact/tests/translate.test.tsx +18 -13
- package/src/surfaces/checkout/preact/tests/tsconfig.json +1 -1
- package/src/surfaces/checkout/shared.ts +2 -0
- package/src/surfaces/point-of-sale/components/Badge.d.ts +10 -1
- package/src/surfaces/point-of-sale/components/Banner/examples/default.html +8 -8
- package/src/surfaces/point-of-sale/components/Banner.d.ts +12 -4
- package/src/surfaces/point-of-sale/components/Box/examples/default.html +2 -2
- package/src/surfaces/point-of-sale/components/Box.d.ts +51 -14
- package/src/surfaces/point-of-sale/components/Button/examples/default.html +2 -4
- package/src/surfaces/point-of-sale/components/Button.d.ts +12 -2
- package/src/surfaces/point-of-sale/components/Choice.d.ts +3 -2
- package/src/surfaces/point-of-sale/components/ChoiceList/examples/default.html +5 -4
- package/src/surfaces/point-of-sale/components/ChoiceList/examples/event-handling.jsx +8 -0
- package/src/surfaces/point-of-sale/components/ChoiceList/examples/multiple-selection.jsx +9 -0
- package/src/surfaces/point-of-sale/components/ChoiceList.d.ts +13 -4
- package/src/surfaces/point-of-sale/components/Clickable/examples/default.html +5 -2
- package/src/surfaces/point-of-sale/components/Clickable.d.ts +11 -4
- package/src/surfaces/point-of-sale/components/DateField/examples/default.html +2 -10
- package/src/surfaces/point-of-sale/components/DateField/examples/event-handling.jsx +8 -0
- package/src/surfaces/point-of-sale/components/DateField.d.ts +20 -13
- package/src/surfaces/point-of-sale/components/DatePicker/examples/command-system.jsx +10 -0
- package/src/surfaces/point-of-sale/components/DatePicker/examples/default.html +4 -5
- package/src/surfaces/point-of-sale/components/DatePicker/examples/event-handling.jsx +7 -0
- package/src/surfaces/point-of-sale/components/DatePicker.d.ts +16 -4
- package/src/surfaces/point-of-sale/components/DateSpinner/examples/command-system.jsx +10 -0
- package/src/surfaces/point-of-sale/components/DateSpinner/examples/default.html +1 -2
- package/src/surfaces/point-of-sale/components/DateSpinner/examples/event-handling.jsx +7 -0
- package/src/surfaces/point-of-sale/components/DateSpinner.d.ts +16 -4
- package/src/surfaces/point-of-sale/components/Divider/examples/default.html +1 -0
- package/src/surfaces/point-of-sale/components/Divider.d.ts +4 -3
- package/src/surfaces/point-of-sale/components/EmailField/examples/accessory-slot.jsx +9 -0
- package/src/surfaces/point-of-sale/components/EmailField/examples/default.html +3 -10
- package/src/surfaces/point-of-sale/components/EmailField/examples/event-handling.jsx +8 -0
- package/src/surfaces/point-of-sale/components/EmailField.d.ts +22 -5
- package/src/surfaces/point-of-sale/components/Heading/examples/default.html +4 -5
- package/src/surfaces/point-of-sale/components/Heading.d.ts +7 -4
- package/src/surfaces/point-of-sale/components/Icon/examples/default.html +4 -1
- package/src/surfaces/point-of-sale/components/Icon.d.ts +13 -3
- package/src/surfaces/point-of-sale/components/Image/examples/default.html +1 -1
- package/src/surfaces/point-of-sale/components/Image.d.ts +12 -5
- package/src/surfaces/point-of-sale/components/Modal/examples/default.html +6 -8
- package/src/surfaces/point-of-sale/components/Modal.d.ts +28 -7
- package/src/surfaces/point-of-sale/components/NumberField/examples/controls-constraints.jsx +9 -0
- package/src/surfaces/point-of-sale/components/NumberField/examples/default.html +5 -2
- package/src/surfaces/point-of-sale/components/NumberField/examples/input-mode.jsx +15 -0
- package/src/surfaces/point-of-sale/components/NumberField.d.ts +32 -23
- package/src/surfaces/point-of-sale/components/Page/examples/default.html +3 -4
- package/src/surfaces/point-of-sale/components/Page.d.ts +25 -11
- package/src/surfaces/point-of-sale/components/PosBlock/examples/default.html +3 -9
- package/src/surfaces/point-of-sale/components/PosBlock.d.ts +12 -13
- package/src/surfaces/point-of-sale/components/QrCode.d.ts +12 -8
- package/src/surfaces/point-of-sale/components/ScrollBox/examples/default.html +5 -4
- package/src/surfaces/point-of-sale/components/ScrollBox.d.ts +47 -15
- package/src/surfaces/point-of-sale/components/SearchField/examples/default.html +1 -1
- package/src/surfaces/point-of-sale/components/SearchField/examples/event-handling.jsx +8 -0
- package/src/surfaces/point-of-sale/components/SearchField.d.ts +17 -5
- package/src/surfaces/point-of-sale/components/Section/examples/default.html +6 -8
- package/src/surfaces/point-of-sale/components/Section.d.ts +15 -9
- package/src/surfaces/point-of-sale/components/Stack/examples/default.html +3 -3
- package/src/surfaces/point-of-sale/components/Stack.d.ts +67 -7
- package/src/surfaces/point-of-sale/components/Text/examples/default.html +3 -6
- package/src/surfaces/point-of-sale/components/Text.d.ts +25 -4
- package/src/surfaces/point-of-sale/components/TextArea/examples/accessory-slot.jsx +9 -0
- package/src/surfaces/point-of-sale/components/TextArea/examples/default.html +4 -1
- package/src/surfaces/point-of-sale/components/TextArea/examples/event-handling.jsx +8 -0
- package/src/surfaces/point-of-sale/components/TextArea/examples/rows-configuration.jsx +7 -0
- package/src/surfaces/point-of-sale/components/TextArea.d.ts +22 -5
- package/src/surfaces/point-of-sale/components/TextField/examples/accessory-slot.jsx +5 -0
- package/src/surfaces/point-of-sale/components/TextField/examples/common-props.jsx +11 -0
- package/src/surfaces/point-of-sale/components/TextField/examples/default.html +5 -3
- package/src/surfaces/point-of-sale/components/TextField/examples/event-handling.jsx +17 -0
- package/src/surfaces/point-of-sale/components/TextField.d.ts +22 -5
- package/src/surfaces/point-of-sale/components/Tile/examples/default.html +2 -5
- package/src/surfaces/point-of-sale/components/Tile.d.ts +12 -2
- package/src/surfaces/point-of-sale/components/TimeField/examples/default.html +1 -9
- package/src/surfaces/point-of-sale/components/TimeField/examples/event-handling.jsx +8 -0
- package/src/surfaces/point-of-sale/components/TimeField.d.ts +18 -6
- package/src/surfaces/point-of-sale/components/TimePicker/examples/command-system.jsx +10 -0
- package/src/surfaces/point-of-sale/components/TimePicker/examples/default.html +4 -1
- package/src/surfaces/point-of-sale/components/TimePicker/examples/event-handling.jsx +7 -0
- package/src/surfaces/point-of-sale/components/TimePicker.d.ts +16 -4
- package/src/surfaces/point-of-sale/components/components-shared.d.ts +102 -1
- package/src/surfaces/point-of-sale/components.d.ts +957 -472
- package/build/ts/surfaces/checkout/errors.d.ts +0 -10
- package/build/ts/surfaces/checkout/errors.d.ts.map +0 -1
- package/src/surfaces/checkout/errors.ts +0 -13
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import {ExtensionHasNoMethodError} from '../../errors';
|
|
2
1
|
import {
|
|
3
2
|
useBuyerJourney,
|
|
4
3
|
useBuyerJourneyActiveStep,
|
|
@@ -7,30 +6,43 @@ import {
|
|
|
7
6
|
useBuyerJourneySteps,
|
|
8
7
|
} from '../buyer-journey';
|
|
9
8
|
|
|
10
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
createMockSubscribableSignalLike,
|
|
11
|
+
mount,
|
|
12
|
+
setupGlobalShopifyMock,
|
|
13
|
+
tearDownGlobalShopifyMock,
|
|
14
|
+
createMockExtension,
|
|
15
|
+
} from './mount';
|
|
16
|
+
|
|
17
|
+
// See __mocks__/preact/hooks
|
|
18
|
+
jest.mock('preact/hooks');
|
|
11
19
|
|
|
12
|
-
describe
|
|
20
|
+
describe('buyerJourney Hooks', () => {
|
|
13
21
|
beforeEach(() => {
|
|
14
22
|
jest.spyOn(console, 'error').mockImplementation(() => {});
|
|
15
23
|
});
|
|
16
24
|
|
|
17
25
|
afterEach(() => {
|
|
26
|
+
tearDownGlobalShopifyMock();
|
|
18
27
|
// eslint-disable-next-line no-console
|
|
19
28
|
jest.mocked(console.error).mockRestore();
|
|
20
29
|
});
|
|
21
30
|
|
|
22
31
|
describe('useBuyerJourneySteps()', () => {
|
|
23
32
|
it('raises an exception when buyerJourney api is not available', () => {
|
|
33
|
+
const target = 'purchase.checkout.header.render-after' as const;
|
|
34
|
+
setupGlobalShopifyMock<typeof target>({
|
|
35
|
+
buyerJourney: undefined,
|
|
36
|
+
extension: createMockExtension(target),
|
|
37
|
+
});
|
|
38
|
+
|
|
24
39
|
expect(() => {
|
|
25
|
-
mount.hook(() => useBuyerJourneySteps()
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
},
|
|
32
|
-
});
|
|
33
|
-
}).toThrow(ExtensionHasNoMethodError);
|
|
40
|
+
mount.hook(() => useBuyerJourneySteps());
|
|
41
|
+
}).toThrow(
|
|
42
|
+
expect.objectContaining({
|
|
43
|
+
name: 'ExtensionHasNoMethodError',
|
|
44
|
+
}),
|
|
45
|
+
);
|
|
34
46
|
});
|
|
35
47
|
|
|
36
48
|
it('returns the list of steps from the buyerJourney.steps subscribable', () => {
|
|
@@ -55,33 +67,33 @@ describe.skip('buyerJourney Hooks', () => {
|
|
|
55
67
|
},
|
|
56
68
|
];
|
|
57
69
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
steps: createMockStatefulRemoteSubscribable(steps),
|
|
62
|
-
},
|
|
63
|
-
extension: {
|
|
64
|
-
target: 'purchase.checkout.header.render-after',
|
|
65
|
-
},
|
|
70
|
+
setupGlobalShopifyMock({
|
|
71
|
+
buyerJourney: {
|
|
72
|
+
steps: createMockSubscribableSignalLike(steps),
|
|
66
73
|
},
|
|
67
74
|
});
|
|
68
75
|
|
|
76
|
+
const hook = mount.hook(() => useBuyerJourneySteps());
|
|
77
|
+
|
|
69
78
|
expect(hook.current).toStrictEqual(steps);
|
|
70
79
|
});
|
|
71
80
|
});
|
|
72
81
|
|
|
73
82
|
describe('useBuyerJourneyActiveStep()', () => {
|
|
74
83
|
it('raises an exception when buyerJourney api is not available', () => {
|
|
84
|
+
const target = 'purchase.checkout.header.render-after' as const;
|
|
85
|
+
setupGlobalShopifyMock<typeof target>({
|
|
86
|
+
buyerJourney: undefined,
|
|
87
|
+
extension: createMockExtension(target),
|
|
88
|
+
});
|
|
89
|
+
|
|
75
90
|
expect(() => {
|
|
76
|
-
mount.hook(() => useBuyerJourneyActiveStep()
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
},
|
|
83
|
-
});
|
|
84
|
-
}).toThrow(ExtensionHasNoMethodError);
|
|
91
|
+
mount.hook(() => useBuyerJourneyActiveStep());
|
|
92
|
+
}).toThrow(
|
|
93
|
+
expect.objectContaining({
|
|
94
|
+
name: 'ExtensionHasNoMethodError',
|
|
95
|
+
}),
|
|
96
|
+
);
|
|
85
97
|
});
|
|
86
98
|
|
|
87
99
|
it('returns the step that matches the activeStep.handle', () => {
|
|
@@ -107,20 +119,17 @@ describe.skip('buyerJourney Hooks', () => {
|
|
|
107
119
|
},
|
|
108
120
|
];
|
|
109
121
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}),
|
|
117
|
-
},
|
|
118
|
-
extension: {
|
|
119
|
-
target: 'purchase.checkout.header.render-after',
|
|
120
|
-
},
|
|
122
|
+
setupGlobalShopifyMock({
|
|
123
|
+
buyerJourney: {
|
|
124
|
+
steps: createMockSubscribableSignalLike(steps),
|
|
125
|
+
activeStep: createMockSubscribableSignalLike({
|
|
126
|
+
handle: activeStepHandle,
|
|
127
|
+
}),
|
|
121
128
|
},
|
|
122
129
|
});
|
|
123
130
|
|
|
131
|
+
const hook = mount.hook(() => useBuyerJourneyActiveStep());
|
|
132
|
+
|
|
124
133
|
expect(hook.current).toStrictEqual(steps[0]);
|
|
125
134
|
});
|
|
126
135
|
|
|
@@ -132,35 +141,29 @@ describe.skip('buyerJourney Hooks', () => {
|
|
|
132
141
|
to: 'shopify:checkout/information',
|
|
133
142
|
};
|
|
134
143
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
}),
|
|
142
|
-
},
|
|
143
|
-
extension: {
|
|
144
|
-
target: 'purchase.checkout.header.render-after',
|
|
145
|
-
},
|
|
144
|
+
setupGlobalShopifyMock({
|
|
145
|
+
buyerJourney: {
|
|
146
|
+
steps: createMockSubscribableSignalLike([step]),
|
|
147
|
+
activeStep: createMockSubscribableSignalLike({
|
|
148
|
+
handle: 'payment' as const,
|
|
149
|
+
}),
|
|
146
150
|
},
|
|
147
151
|
});
|
|
148
152
|
|
|
153
|
+
const hook = mount.hook(() => useBuyerJourneyActiveStep());
|
|
154
|
+
|
|
149
155
|
expect(hook.current).toBeUndefined();
|
|
150
156
|
});
|
|
151
157
|
});
|
|
152
158
|
|
|
153
159
|
describe('useBuyerJourney()', () => {
|
|
154
160
|
it('returns the buyer journey when the api is available', () => {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
buyerJourney: {},
|
|
158
|
-
extension: {
|
|
159
|
-
target: 'purchase.checkout.header.render-after',
|
|
160
|
-
},
|
|
161
|
-
},
|
|
161
|
+
setupGlobalShopifyMock({
|
|
162
|
+
buyerJourney: {},
|
|
162
163
|
});
|
|
163
164
|
|
|
165
|
+
const hook = mount.hook(() => useBuyerJourney());
|
|
166
|
+
|
|
164
167
|
expect(hook.current).toStrictEqual({});
|
|
165
168
|
});
|
|
166
169
|
});
|
|
@@ -169,17 +172,14 @@ describe.skip('buyerJourney Hooks', () => {
|
|
|
169
172
|
it.each([true, false])(
|
|
170
173
|
'returns the buyer journey completed value: %s',
|
|
171
174
|
(completed) => {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
completed: createMockStatefulRemoteSubscribable(completed),
|
|
176
|
-
},
|
|
177
|
-
extension: {
|
|
178
|
-
target: 'purchase.checkout.header.render-after',
|
|
179
|
-
},
|
|
175
|
+
setupGlobalShopifyMock({
|
|
176
|
+
buyerJourney: {
|
|
177
|
+
completed: createMockSubscribableSignalLike(completed),
|
|
180
178
|
},
|
|
181
179
|
});
|
|
182
180
|
|
|
181
|
+
const hook = mount.hook(() => useBuyerJourneyCompleted());
|
|
182
|
+
|
|
183
183
|
expect(hook.current).toStrictEqual(completed);
|
|
184
184
|
},
|
|
185
185
|
);
|
|
@@ -191,17 +191,14 @@ describe.skip('buyerJourney Hooks', () => {
|
|
|
191
191
|
Promise.resolve({behavior: 'allow'} as const),
|
|
192
192
|
);
|
|
193
193
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
intercept: (cb: () => void) => cb(),
|
|
198
|
-
},
|
|
199
|
-
extension: {
|
|
200
|
-
target: 'purchase.checkout.header.render-after',
|
|
201
|
-
},
|
|
194
|
+
setupGlobalShopifyMock({
|
|
195
|
+
buyerJourney: {
|
|
196
|
+
intercept: (cb: () => void) => cb(),
|
|
202
197
|
},
|
|
203
198
|
});
|
|
204
199
|
|
|
200
|
+
mount.hook(() => useBuyerJourneyIntercept(mockIntercept));
|
|
201
|
+
|
|
205
202
|
expect(mockIntercept).toHaveBeenCalled();
|
|
206
203
|
});
|
|
207
204
|
});
|
|
@@ -1,58 +1,62 @@
|
|
|
1
|
-
import type {Extension} from '
|
|
1
|
+
import type {Extension} from '../../api/standard/standard';
|
|
2
|
+
|
|
3
|
+
// See __mocks__/preact/hooks
|
|
4
|
+
jest.mock('preact/hooks');
|
|
2
5
|
|
|
3
6
|
import {
|
|
4
7
|
useExtensionCapabilities,
|
|
5
8
|
useExtensionCapability,
|
|
6
9
|
} from '../capabilities';
|
|
7
10
|
|
|
8
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
mount,
|
|
13
|
+
createMockSubscribableSignalLike,
|
|
14
|
+
setupGlobalShopifyMock,
|
|
15
|
+
tearDownGlobalShopifyMock,
|
|
16
|
+
} from './mount';
|
|
17
|
+
|
|
18
|
+
describe('useExtensionCapabilities', () => {
|
|
19
|
+
afterEach(tearDownGlobalShopifyMock);
|
|
9
20
|
|
|
10
|
-
describe.skip('useExtensionCapabilities', () => {
|
|
11
21
|
it('returns a list of granted capabilities of the extension', () => {
|
|
12
22
|
const capabilities = ['network_access', 'block_progress'];
|
|
13
23
|
|
|
14
|
-
const capabilitiesSubscribable =
|
|
24
|
+
const capabilitiesSubscribable = createMockSubscribableSignalLike(
|
|
15
25
|
capabilities,
|
|
16
26
|
) as Extension['capabilities'];
|
|
17
27
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
capabilities: capabilitiesSubscribable,
|
|
22
|
-
},
|
|
28
|
+
setupGlobalShopifyMock({
|
|
29
|
+
extension: {
|
|
30
|
+
capabilities: capabilitiesSubscribable,
|
|
23
31
|
},
|
|
24
32
|
});
|
|
25
33
|
|
|
34
|
+
const {value} = mount.hook(useExtensionCapabilities);
|
|
35
|
+
|
|
26
36
|
expect(value).toStrictEqual(capabilities);
|
|
27
37
|
});
|
|
28
38
|
});
|
|
29
39
|
|
|
30
|
-
describe
|
|
40
|
+
describe('useExtensionCapability', () => {
|
|
41
|
+
afterEach(tearDownGlobalShopifyMock);
|
|
42
|
+
|
|
31
43
|
it('returns the status of a capabilities', () => {
|
|
32
|
-
const capabilities =
|
|
44
|
+
const capabilities = createMockSubscribableSignalLike([
|
|
33
45
|
'network_access',
|
|
34
46
|
]) as Extension['capabilities'];
|
|
35
47
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
extensionApi: {
|
|
40
|
-
extension: {
|
|
41
|
-
capabilities,
|
|
42
|
-
},
|
|
43
|
-
},
|
|
48
|
+
setupGlobalShopifyMock({
|
|
49
|
+
extension: {
|
|
50
|
+
capabilities,
|
|
44
51
|
},
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
const {value: activatedCapability} = mount.hook(() =>
|
|
55
|
+
useExtensionCapability('network_access'),
|
|
45
56
|
);
|
|
46
57
|
|
|
47
|
-
const {value: deactivatedCapability} = mount.hook(
|
|
48
|
-
|
|
49
|
-
{
|
|
50
|
-
extensionApi: {
|
|
51
|
-
extension: {
|
|
52
|
-
capabilities,
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
},
|
|
58
|
+
const {value: deactivatedCapability} = mount.hook(() =>
|
|
59
|
+
useExtensionCapability('block_progress'),
|
|
56
60
|
);
|
|
57
61
|
|
|
58
62
|
expect(activatedCapability).toBe(true);
|
|
@@ -1,23 +1,30 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {CartLine} from '../../api/standard/standard';
|
|
2
2
|
|
|
3
3
|
import {useCartLineTarget} from '../cart-line-target';
|
|
4
|
-
import {ExtensionHasNoTargetError} from '../../errors';
|
|
5
|
-
import {useApi} from '../api';
|
|
6
|
-
|
|
7
|
-
import {createMockStatefulRemoteSubscribable, mount} from './mount';
|
|
8
|
-
|
|
9
|
-
describe.skip('useCartLineTarget', () => {
|
|
10
|
-
it('throws if extension target has no api.target', async () => {
|
|
11
|
-
const runner = async () => {
|
|
12
|
-
const target: ExtensionTarget = 'purchase.checkout.block.render';
|
|
13
|
-
return mount.hook(() => useCartLineTarget(), {
|
|
14
|
-
extensionApi: {
|
|
15
|
-
extension: {target},
|
|
16
|
-
},
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
4
|
|
|
20
|
-
|
|
5
|
+
// See __mocks__/preact/hooks
|
|
6
|
+
jest.mock('preact/hooks');
|
|
7
|
+
import {
|
|
8
|
+
createMockSubscribableSignalLike,
|
|
9
|
+
mount,
|
|
10
|
+
setupGlobalShopifyMock,
|
|
11
|
+
tearDownGlobalShopifyMock,
|
|
12
|
+
createMockExtension,
|
|
13
|
+
} from './mount';
|
|
14
|
+
|
|
15
|
+
describe('useCartLineTarget', () => {
|
|
16
|
+
afterEach(tearDownGlobalShopifyMock);
|
|
17
|
+
|
|
18
|
+
it('throws if extension target has no api.target', () => {
|
|
19
|
+
setupGlobalShopifyMock({});
|
|
20
|
+
|
|
21
|
+
expect(() => {
|
|
22
|
+
mount.hook(() => useCartLineTarget());
|
|
23
|
+
}).toThrow(
|
|
24
|
+
expect.objectContaining({
|
|
25
|
+
name: 'ExtensionHasNoTargetError',
|
|
26
|
+
}),
|
|
27
|
+
);
|
|
21
28
|
});
|
|
22
29
|
|
|
23
30
|
it('returns the cart line target if it exists', async () => {
|
|
@@ -45,17 +52,17 @@ describe.skip('useCartLineTarget', () => {
|
|
|
45
52
|
},
|
|
46
53
|
attributes: [],
|
|
47
54
|
discountAllocations: [],
|
|
55
|
+
parentRelationship: null,
|
|
48
56
|
} as CartLine;
|
|
49
57
|
|
|
50
|
-
const target
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
extension: {target},
|
|
55
|
-
target: createMockStatefulRemoteSubscribable(line),
|
|
56
|
-
},
|
|
58
|
+
const target = 'purchase.cart-line-item.line-components.render' as const;
|
|
59
|
+
setupGlobalShopifyMock<typeof target>({
|
|
60
|
+
target: createMockSubscribableSignalLike(line),
|
|
61
|
+
extension: createMockExtension(target),
|
|
57
62
|
});
|
|
58
63
|
|
|
64
|
+
const {value} = mount.hook(() => useCartLineTarget());
|
|
65
|
+
|
|
59
66
|
expect(value).toStrictEqual(line);
|
|
60
67
|
});
|
|
61
68
|
});
|
|
@@ -1,10 +1,20 @@
|
|
|
1
|
-
import type {CheckoutSettings} from '
|
|
1
|
+
import type {CheckoutSettings} from '../../api/standard/standard';
|
|
2
2
|
|
|
3
3
|
import {useCheckoutSettings} from '../checkout-settings';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// See __mocks__/preact/hooks
|
|
6
|
+
jest.mock('preact/hooks');
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
mount,
|
|
10
|
+
createMockSubscribableSignalLike,
|
|
11
|
+
setupGlobalShopifyMock,
|
|
12
|
+
tearDownGlobalShopifyMock,
|
|
13
|
+
} from './mount';
|
|
14
|
+
|
|
15
|
+
describe('useCheckoutSettings', () => {
|
|
16
|
+
afterEach(tearDownGlobalShopifyMock);
|
|
6
17
|
|
|
7
|
-
describe.skip('useCheckoutSettings', () => {
|
|
8
18
|
it('returns checkout settings from the api', () => {
|
|
9
19
|
const checkoutSettings = {
|
|
10
20
|
orderSubmission: 'ORDER',
|
|
@@ -14,14 +24,12 @@ describe.skip('useCheckoutSettings', () => {
|
|
|
14
24
|
paymentTermsTemplate: undefined,
|
|
15
25
|
} as CheckoutSettings;
|
|
16
26
|
|
|
17
|
-
|
|
18
|
-
checkoutSettings:
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
const {value} = mount.hook(() => useCheckoutSettings(), {
|
|
22
|
-
extensionApi,
|
|
27
|
+
setupGlobalShopifyMock({
|
|
28
|
+
checkoutSettings: createMockSubscribableSignalLike(checkoutSettings),
|
|
23
29
|
});
|
|
24
30
|
|
|
31
|
+
const {value} = mount.hook(() => useCheckoutSettings());
|
|
32
|
+
|
|
25
33
|
expect(value).toStrictEqual(checkoutSettings);
|
|
26
34
|
});
|
|
27
35
|
});
|
|
@@ -1,17 +1,27 @@
|
|
|
1
1
|
import {useCheckoutToken} from '../checkout-token';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// See __mocks__/preact/hooks
|
|
4
|
+
jest.mock('preact/hooks');
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
mount,
|
|
8
|
+
createMockSubscribableSignalLike,
|
|
9
|
+
setupGlobalShopifyMock,
|
|
10
|
+
tearDownGlobalShopifyMock,
|
|
11
|
+
} from './mount';
|
|
12
|
+
|
|
13
|
+
describe('useCheckoutToken', () => {
|
|
14
|
+
afterEach(tearDownGlobalShopifyMock);
|
|
4
15
|
|
|
5
|
-
describe.skip('useCheckoutToken', () => {
|
|
6
16
|
it('returns checkoutToken from the api', () => {
|
|
7
17
|
const checkoutToken = 'checkout-token';
|
|
8
18
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
checkoutToken: createMockStatefulRemoteSubscribable(checkoutToken),
|
|
12
|
-
},
|
|
19
|
+
setupGlobalShopifyMock({
|
|
20
|
+
checkoutToken: createMockSubscribableSignalLike(checkoutToken),
|
|
13
21
|
});
|
|
14
22
|
|
|
23
|
+
const {value} = mount.hook(() => useCheckoutToken());
|
|
24
|
+
|
|
15
25
|
expect(value).toBe(checkoutToken);
|
|
16
26
|
});
|
|
17
27
|
});
|
|
@@ -1,17 +1,27 @@
|
|
|
1
1
|
import {useSettings} from '../settings';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// See __mocks__/preact/hooks
|
|
4
|
+
jest.mock('preact/hooks');
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
mount,
|
|
8
|
+
createMockSubscribableSignalLike,
|
|
9
|
+
setupGlobalShopifyMock,
|
|
10
|
+
tearDownGlobalShopifyMock,
|
|
11
|
+
} from './mount';
|
|
12
|
+
|
|
13
|
+
describe('useSettings', () => {
|
|
14
|
+
afterEach(tearDownGlobalShopifyMock);
|
|
4
15
|
|
|
5
|
-
describe.skip('useSettings', () => {
|
|
6
16
|
it('returns settings from the api', () => {
|
|
7
17
|
const settings = {title: 'checkout ui'};
|
|
8
18
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
settings: createMockStatefulRemoteSubscribable(settings),
|
|
12
|
-
},
|
|
19
|
+
setupGlobalShopifyMock({
|
|
20
|
+
settings: createMockSubscribableSignalLike(settings),
|
|
13
21
|
});
|
|
14
22
|
|
|
23
|
+
const {value} = mount.hook(() => useSettings());
|
|
24
|
+
|
|
15
25
|
expect(value).toStrictEqual(settings);
|
|
16
26
|
});
|
|
17
27
|
});
|
|
@@ -1,21 +1,31 @@
|
|
|
1
|
-
import type {CountryCode} from '
|
|
1
|
+
import type {CountryCode} from '../../../../shared';
|
|
2
2
|
|
|
3
3
|
import {useLocalizationCountry} from '../country';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// See __mocks__/preact/hooks
|
|
6
|
+
jest.mock('preact/hooks');
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
mount,
|
|
10
|
+
createMockSubscribableSignalLike,
|
|
11
|
+
setupGlobalShopifyMock,
|
|
12
|
+
tearDownGlobalShopifyMock,
|
|
13
|
+
} from './mount';
|
|
14
|
+
|
|
15
|
+
describe('useLocalizationCountry', () => {
|
|
16
|
+
afterEach(tearDownGlobalShopifyMock);
|
|
6
17
|
|
|
7
|
-
describe.skip('useLocalizationCountry', () => {
|
|
8
18
|
it('returns country from the api', () => {
|
|
9
19
|
const country: {isoCode: CountryCode} = {isoCode: 'CA'};
|
|
10
20
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
country: createMockStatefulRemoteSubscribable(country),
|
|
15
|
-
},
|
|
21
|
+
setupGlobalShopifyMock({
|
|
22
|
+
localization: {
|
|
23
|
+
country: createMockSubscribableSignalLike(country),
|
|
16
24
|
},
|
|
17
25
|
});
|
|
18
26
|
|
|
27
|
+
const {value} = mount.hook(() => useLocalizationCountry());
|
|
28
|
+
|
|
19
29
|
expect(value).toStrictEqual(country);
|
|
20
30
|
});
|
|
21
31
|
});
|
|
@@ -1,21 +1,31 @@
|
|
|
1
|
-
import type {CurrencyCode} from '
|
|
1
|
+
import type {CurrencyCode} from '../../../../shared';
|
|
2
2
|
|
|
3
3
|
import {useCurrency} from '../currency';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// See __mocks__/preact/hooks
|
|
6
|
+
jest.mock('preact/hooks');
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
mount,
|
|
10
|
+
createMockSubscribableSignalLike,
|
|
11
|
+
setupGlobalShopifyMock,
|
|
12
|
+
tearDownGlobalShopifyMock,
|
|
13
|
+
} from './mount';
|
|
14
|
+
|
|
15
|
+
describe('useCurrency', () => {
|
|
16
|
+
afterEach(tearDownGlobalShopifyMock);
|
|
6
17
|
|
|
7
|
-
describe.skip('useCurrency', () => {
|
|
8
18
|
it('returns currency from the api', () => {
|
|
9
19
|
const currency: {isoCode: CurrencyCode} = {isoCode: 'CAD'};
|
|
10
20
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
currency: createMockStatefulRemoteSubscribable(currency),
|
|
15
|
-
},
|
|
21
|
+
setupGlobalShopifyMock({
|
|
22
|
+
localization: {
|
|
23
|
+
currency: createMockSubscribableSignalLike(currency),
|
|
16
24
|
},
|
|
17
25
|
});
|
|
18
26
|
|
|
27
|
+
const {value} = mount.hook(() => useCurrency());
|
|
28
|
+
|
|
19
29
|
expect(value).toStrictEqual(currency);
|
|
20
30
|
});
|
|
21
31
|
});
|
|
@@ -1,10 +1,20 @@
|
|
|
1
|
-
import type {CustomerPrivacy} from '
|
|
1
|
+
import type {CustomerPrivacy} from '../../api/standard/standard';
|
|
2
2
|
|
|
3
3
|
import {useCustomerPrivacy} from '../customer-privacy';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// See __mocks__/preact/hooks
|
|
6
|
+
jest.mock('preact/hooks');
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
mount,
|
|
10
|
+
createMockSubscribableSignalLike,
|
|
11
|
+
setupGlobalShopifyMock,
|
|
12
|
+
tearDownGlobalShopifyMock,
|
|
13
|
+
} from './mount';
|
|
14
|
+
|
|
15
|
+
describe('useCustomerPrivacy', () => {
|
|
16
|
+
afterEach(tearDownGlobalShopifyMock);
|
|
6
17
|
|
|
7
|
-
describe.skip('useCustomerPrivacy', () => {
|
|
8
18
|
it('returns customer privacy settings and data from the API', () => {
|
|
9
19
|
const customerPrivacyValue: CustomerPrivacy = {
|
|
10
20
|
allowedProcessing: {
|
|
@@ -26,12 +36,11 @@ describe.skip('useCustomerPrivacy', () => {
|
|
|
26
36
|
},
|
|
27
37
|
};
|
|
28
38
|
|
|
29
|
-
|
|
30
|
-
customerPrivacy:
|
|
31
|
-
|
|
32
|
-
};
|
|
39
|
+
setupGlobalShopifyMock({
|
|
40
|
+
customerPrivacy: createMockSubscribableSignalLike(customerPrivacyValue),
|
|
41
|
+
});
|
|
33
42
|
|
|
34
|
-
const {value} = mount.hook(() => useCustomerPrivacy()
|
|
43
|
+
const {value} = mount.hook(() => useCustomerPrivacy());
|
|
35
44
|
|
|
36
45
|
expect(value).toMatchObject(customerPrivacyValue);
|
|
37
46
|
});
|