From 986918f86bcfbd25ace29d9614e9c49e65f82615 Mon Sep 17 00:00:00 2001 From: Emili Castells Guasch Date: Sat, 22 Jun 2024 15:53:46 +0200 Subject: [PATCH] Add test for checkout handler component --- .../resources/js/test/checkout-handler.test.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/modules/ppcp-blocks/resources/js/test/checkout-handler.test.js b/modules/ppcp-blocks/resources/js/test/checkout-handler.test.js index 933149bd0..5043550fd 100644 --- a/modules/ppcp-blocks/resources/js/test/checkout-handler.test.js +++ b/modules/ppcp-blocks/resources/js/test/checkout-handler.test.js @@ -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"; -test('checkout handler', () => { - render( {}}/>) +test('checkout handler label display given text', async () => { + render( + {}} + saveCardText="Foo" + is_vaulting_enabled={true} + /> + ); + + await expect(screen.getByLabelText('Foo')).toBeInTheDocument(); });