Add test for checkout handler component

This commit is contained in:
Emili Castells Guasch 2024-06-22 15:53:46 +02:00
parent ddcdf67816
commit 986918f86b

View file

@ -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();
}); });