Skip to content
This repository has been archived by the owner on Jul 14, 2022. It is now read-only.

Add test tags to address book #847

Merged
merged 4 commits into from
Aug 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ All notable, unreleased changes to this project will be documented in this file.
- Fix tsconfig aliases - #824 by @orzechdev
- Set billing address in first checkout step - #822 by @orzechdev
- Persist payment gateways for the whole checkout - #828 by @orzechdev
- Add test tags to address book - #847 by @dominik-zeglen

## 2.10.4

Expand Down
1 change: 1 addition & 0 deletions src/@next/components/atoms/DropdownMenu/DropdownMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const DropdownMenu: React.FC<IProps> = ({
setVisible(false);
element.onClick();
}}
data-test={element.testingContext}
>
{element.content}
</li>
Expand Down
1 change: 1 addition & 0 deletions src/@next/components/atoms/DropdownMenu/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export interface MenuItem {
content: React.ReactNode;
testingContext?: string;
onClick: () => void;
}

Expand Down
7 changes: 6 additions & 1 deletion src/@next/components/molecules/AddressTile/AddressTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,14 @@ export const AddressTile: React.FC<IProps> = ({
onClick: () => {
setDefault("BILLING");
},
testingContext: "set-billing",
},
{
content: defaultShippingAddress,
onClick: () => {
setDefault("SHIPPING");
},
testingContext: "set-shipping",
},
]}
/>
Expand Down Expand Up @@ -79,7 +81,10 @@ export const AddressTile: React.FC<IProps> = ({

const content = <Address {...address} />;
return (
<S.Wrapper>
<S.Wrapper
data-test-billing-default={address.isDefaultBillingAddress}
data-test-shipping-default={address.isDefaultShippingAddress}
>
<Tile footer={footer} header={header}>
{content}
</Tile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ exports[`Storyshots @components/molecules/AddressTile default 1`] = `
>
<div
className="c2"
data-test-billing-default={false}
data-test-shipping-default={true}
>
<div
className="c3"
Expand Down Expand Up @@ -419,6 +421,8 @@ exports[`Storyshots @components/molecules/AddressTile with default shipping and
>
<div
className="c2"
data-test-billing-default={false}
data-test-shipping-default={false}
>
<div
className="c3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,8 @@ exports[`Storyshots @components/organisms/AddressGrid default 1`] = `
>
<div
className="c6"
data-test-billing-default={false}
data-test-shipping-default={true}
>
<div
className="c7"
Expand Down Expand Up @@ -393,6 +395,8 @@ exports[`Storyshots @components/organisms/AddressGrid default 1`] = `
>
<div
className="c6"
data-test-billing-default={false}
data-test-shipping-default={true}
>
<div
className="c7"
Expand Down Expand Up @@ -511,6 +515,8 @@ exports[`Storyshots @components/organisms/AddressGrid default 1`] = `
>
<div
className="c6"
data-test-billing-default={false}
data-test-shipping-default={true}
>
<div
className="c7"
Expand Down Expand Up @@ -633,6 +639,8 @@ exports[`Storyshots @components/organisms/AddressGrid default 1`] = `
>
<div
className="c6"
data-test-billing-default={false}
data-test-shipping-default={true}
>
<div
className="c7"
Expand Down