-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into update/deprecating-sofort-from-checkout
- Loading branch information
Showing
73 changed files
with
2,630 additions
and
1,215 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: dev | ||
|
||
Add e2e tests for the multi-currency widget setup. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: minor | ||
Type: add | ||
|
||
Show Bank reference key on top of the payout details page, whenever available. |
4 changes: 4 additions & 0 deletions
4
changelog/dev-10063-playwright-migration-shopper-checkout-purchase-site-editor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: dev | ||
|
||
Convert shopper checkout with site editor theme spec to Playwright |
4 changes: 4 additions & 0 deletions
4
changelog/dev-10066-playwright-migration-shopper-checkout-save-card-and-purchase
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: dev | ||
|
||
Convert shopper checkout save card and purchase test to Playwright |
4 changes: 4 additions & 0 deletions
4
changelog/dev-10069-e2e-convert-shopper-myaccount-payment-methods-add-fail-spec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: dev | ||
|
||
Convert the shopper-myaccount-payment-methods-add-fail spec from Puppeteer to Playwright. |
5 changes: 5 additions & 0 deletions
5
changelog/dev-10073-convert-shopper-wc-blocks-checkout-failures-spec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Significance: patch | ||
Type: dev | ||
Comment: Convert shopper-wc-blocks-checkout-failures spec from Puppeteer to Playwright | ||
|
||
|
4 changes: 4 additions & 0 deletions
4
changelog/dev-10075-playwright-migration-shopper-wc-blocks-saved-card-checkout-and-usage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: dev | ||
|
||
Convert Shopper WC Blocks saved card checkout and usage test to Playwright |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: dev | ||
|
||
Refactoring of snackbar checks in Playwright e2e tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: fix | ||
|
||
Fix flaky Multi-Currency test. |
4 changes: 4 additions & 0 deletions
4
changelog/dev-9964-playwright-migration-order-refund-failures
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: dev | ||
|
||
Convert order refund failure E2E tests to Playwright |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: dev | ||
|
||
Refresh customer instance with REST API, replace customer creation by new order with anonymous customer |
4 changes: 4 additions & 0 deletions
4
changelog/fix-10023-handle-repeated_card-present-payment-failures
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: fix | ||
|
||
Added timestamp to the order note when terminal payment fails. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: fix | ||
|
||
Prevent potential fatal when initializing the WooPay express checkout button. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: dev | ||
|
||
Remove the subscriptions spec for Puppeteer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: dev | ||
|
||
Fix flakiness in saved card tests caused by selling the same cart multiple times, triggering duplicate order protection |
4 changes: 4 additions & 0 deletions
4
changelog/fix-tokenized-ece-with-no-address-on-initialization
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: fix | ||
|
||
fix: avoid ECE error when no address is provided on initialization |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: update | ||
|
||
Design improvements related to the overview page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Significance: patch | ||
Type: update | ||
Comment: Bump wc tested up to 9.6.0 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import React, { useState } from 'react'; | ||
import { __ } from '@wordpress/i18n'; | ||
import classNames from 'classnames'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import './style.scss'; | ||
|
||
interface CopyButtonProps { | ||
/** | ||
* The text to copy to the clipboard. | ||
*/ | ||
textToCopy: string; | ||
|
||
/** | ||
* The label for the button. Also used as the aria-label. | ||
*/ | ||
label: string; | ||
} | ||
|
||
export const CopyButton: React.FC< CopyButtonProps > = ( { | ||
textToCopy, | ||
label, | ||
} ) => { | ||
const [ copied, setCopied ] = useState( false ); | ||
|
||
const copyToClipboard = () => { | ||
navigator.clipboard.writeText( textToCopy ); | ||
setCopied( true ); | ||
}; | ||
|
||
return ( | ||
<button | ||
type="button" | ||
className={ classNames( 'woopayments-copy-button', { | ||
'state--copied': copied, | ||
} ) } | ||
aria-label={ label } | ||
title={ __( 'Copy to clipboard', 'woocommerce-payments' ) } | ||
onClick={ copyToClipboard } | ||
onAnimationEnd={ () => setCopied( false ) } | ||
> | ||
<i></i> | ||
</button> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
.woopayments-copy-button { | ||
line-height: 1.2em; | ||
display: inline-flex; | ||
background: transparent; | ||
border: none; | ||
border-radius: 0; | ||
vertical-align: middle; | ||
font-weight: normal; | ||
cursor: pointer; | ||
color: inherit; | ||
margin-left: 2px; | ||
align-items: center; | ||
|
||
i { | ||
display: block; | ||
width: 1.2em; | ||
height: 1.2em; | ||
mask-image: url( 'assets/images/icons/copy.svg?asset' ); | ||
mask-size: contain; | ||
mask-repeat: no-repeat; | ||
mask-position: center; | ||
background-color: currentColor; | ||
|
||
&:hover { | ||
opacity: 0.7; | ||
} | ||
|
||
&:active { | ||
transform: scale( 0.9 ); | ||
} | ||
} | ||
|
||
&.state--copied i { | ||
mask-image: url( 'assets/images/icons/check-green.svg?asset' ); | ||
background-color: $studio-green-50; | ||
animation: copy-indicator 2s forwards; | ||
} | ||
|
||
@keyframes copy-indicator { | ||
0% { | ||
opacity: 1; | ||
} | ||
95% { | ||
opacity: 1; | ||
} | ||
// a quick fade-out from 1%→0% at the end | ||
100% { | ||
opacity: 0; | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
client/components/copy-button/test/__snapshots__/index.test.tsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`CopyButton renders the button correctly 1`] = ` | ||
<div> | ||
<button | ||
aria-label="Copy bank reference ID to clipboard" | ||
class="woopayments-copy-button" | ||
title="Copy to clipboard" | ||
type="button" | ||
> | ||
<i /> | ||
</button> | ||
</div> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/** @format **/ | ||
|
||
/** | ||
* External dependencies | ||
*/ | ||
import React from 'react'; | ||
import { act, fireEvent, render, screen } from '@testing-library/react'; | ||
import '@testing-library/jest-dom/extend-expect'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import { CopyButton } from '..'; | ||
|
||
describe( 'CopyButton', () => { | ||
it( 'renders the button correctly', () => { | ||
const { container: copyButtonContainer } = render( | ||
<CopyButton | ||
textToCopy="test_bank_reference_id" | ||
label="Copy bank reference ID to clipboard" | ||
/> | ||
); | ||
|
||
expect( copyButtonContainer ).toMatchSnapshot(); | ||
} ); | ||
|
||
describe( 'when the button is clicked', () => { | ||
it( 'copies the text to the clipboard and shows copied state', async () => { | ||
render( | ||
<CopyButton | ||
textToCopy="test_bank_reference_id" | ||
label="Copy bank reference ID to clipboard" | ||
/> | ||
); | ||
|
||
const button = screen.queryByRole( 'button', { | ||
name: /Copy bank reference ID to clipboard/i, | ||
} ); | ||
|
||
if ( ! button ) { | ||
throw new Error( 'Button not found' ); | ||
} | ||
|
||
//Mock the clipboard API | ||
Object.assign( navigator, { | ||
clipboard: { | ||
writeText: jest.fn().mockResolvedValueOnce( undefined ), | ||
}, | ||
} ); | ||
|
||
await act( async () => { | ||
fireEvent.click( button ); | ||
} ); | ||
|
||
expect( navigator.clipboard.writeText ).toHaveBeenCalledWith( | ||
'test_bank_reference_id' | ||
); | ||
expect( button ).toHaveClass( 'state--copied' ); | ||
|
||
act( () => { | ||
fireEvent.animationEnd( button ); | ||
} ); | ||
|
||
expect( button ).not.toHaveClass( 'state--copied' ); | ||
} ); | ||
} ); | ||
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.