diff --git a/src/components/createElementComponent.test.tsx b/src/components/createElementComponent.test.tsx index 1ea2ba4..a712e08 100644 --- a/src/components/createElementComponent.test.tsx +++ b/src/components/createElementComponent.test.tsx @@ -9,8 +9,8 @@ import { PaymentElementComponent, PaymentRequestButtonElementComponent, CartElementComponent, + PayButtonElementComponent, } from '../types'; -import {PayButtonElement} from '..'; const {Elements} = ElementsModule; @@ -176,6 +176,11 @@ describe('createElementComponent', () => { false ); + const PayButtonElement: PayButtonElementComponent = createElementComponent( + 'payButton', + false + ); + it('Can remove and add CardElement at the same time', () => { let cardMounted = false; mockElement.mount.mockImplementation(() => { @@ -551,7 +556,7 @@ describe('createElementComponent', () => { expect(mockHandler).not.toHaveBeenCalled(); }); - it('propagates the Element`s lineitemclick event to the current onConfirm prop', () => { + it('propagates the Element`s confirm event to the current onConfirm prop', () => { const mockHandler = jest.fn(); const mockHandler2 = jest.fn(); const {rerender} = render( @@ -565,7 +570,7 @@ describe('createElementComponent', () => { ); - const confirmEventMock = Symbol('lineitemclick'); + const confirmEventMock = Symbol('confirm'); simulateConfirm(confirmEventMock); expect(mockHandler2).toHaveBeenCalledWith(confirmEventMock); expect(mockHandler).not.toHaveBeenCalled(); @@ -585,7 +590,7 @@ describe('createElementComponent', () => { ); - const cancelEventMock = Symbol('lineitemclick'); + const cancelEventMock = Symbol('cancel'); simulateCancel(cancelEventMock); expect(mockHandler2).toHaveBeenCalledWith(cancelEventMock); expect(mockHandler).not.toHaveBeenCalled();