mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-01 07:02:48 +08:00
Add test for checkout handler component
This commit is contained in:
parent
ddcdf67816
commit
986918f86b
1 changed files with 12 additions and 3 deletions
|
@ -1,6 +1,15 @@
|
||||||
import { render} from '@testing-library/react';
|
import {render, screen} from '@testing-library/react';
|
||||||
|
import '@testing-library/jest-dom';
|
||||||
import {CheckoutHandler} from "../Components/checkout-handler";
|
import {CheckoutHandler} from "../Components/checkout-handler";
|
||||||
|
|
||||||
test('checkout handler', () => {
|
test('checkout handler label display given text', async () => {
|
||||||
render(<CheckoutHandler getCardFieldsForm={() => {}}/>)
|
render(
|
||||||
|
<CheckoutHandler
|
||||||
|
getCardFieldsForm={() => {}}
|
||||||
|
saveCardText="Foo"
|
||||||
|
is_vaulting_enabled={true}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
|
||||||
|
await expect(screen.getByLabelText('Foo')).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue