Add text for manage button when no help text exists (https://github.com/woocommerce/woocommerce-admin/pull/7191)

* Add text for manage button when no help text exists

* Update manage button text to set up

* Handle PR feedback
This commit is contained in:
Joshua T Flowers 2021-06-22 20:07:03 -04:00 committed by GitHub
parent 3327a23378
commit 86ee870873
3 changed files with 13 additions and 6 deletions

View File

@ -240,8 +240,8 @@
font-size: 14px;
color: $studio-gray-50;
font-weight: 400;
margin-top: 16px;
margin-bottom: $gap-smaller;
margin-top: $gap;
margin-bottom: $gap;
}
}

View File

@ -142,9 +142,16 @@ export const Connect = ( {
return (
<>
{ helpText }
{ helpText || (
<p>
{ __(
"You can manage this payment gateway's settings by clicking the button below",
'woocommerce-admin'
) }
</p>
) }
<Button isPrimary href={ settingsUrl }>
{ __( 'Manage', 'woocommerce-admin' ) }
{ __( 'Set up', 'woocommerce-admin' ) }
</Button>
</>
);

View File

@ -68,7 +68,7 @@ describe( 'Connect', () => {
expect( inputs[ 1 ].placeholder ).toBe( 'API secret' );
} );
it( 'should render the manage button when no connection URL or fields exist', () => {
it( 'should render the set up button when no connection URL or fields exist', () => {
const props = {
...defaultProps,
paymentGateway: {
@ -80,7 +80,7 @@ describe( 'Connect', () => {
const { container } = render( <Connect { ...props } /> );
const button = container.querySelector( 'a' );
expect( button.textContent ).toBe( 'Manage' );
expect( button.textContent ).toBe( 'Set up' );
expect( button.href ).toBe( mockGateway.settingsUrl );
} );
} );