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

Commit

Permalink
Merge pull request #847 from mirumee/add/test-tags-account
Browse files Browse the repository at this point in the history
Add test tags to address book
  • Loading branch information
dominik-zeglen authored Aug 11, 2020
2 parents 98701ff + 6f4be33 commit 721e193
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 1 deletion.
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

0 comments on commit 721e193

Please sign in to comment.