From aefadce025223c0a554df3473c04ab7a5a386751 Mon Sep 17 00:00:00 2001 From: Bill Richardson Date: Mon, 5 Feb 2024 14:46:21 -0500 Subject: [PATCH] Update to what i believe is our way to do setupMock --- .../payment-method-list-button.spec.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/layouts/payment-method/payment-method-question/payment-method-list-button/payment-method-list-button.spec.js b/src/layouts/payment-method/payment-method-question/payment-method-list-button/payment-method-list-button.spec.js index ec29f8cc..8e95131d 100644 --- a/src/layouts/payment-method/payment-method-question/payment-method-list-button/payment-method-list-button.spec.js +++ b/src/layouts/payment-method/payment-method-question/payment-method-list-button/payment-method-list-button.spec.js @@ -27,13 +27,20 @@ function generateDefaultProps() { buttonLabel: testConstants.content.noInline, altText: testConstants.content.noInline, groupName: 'payment-method', - value: testConstants.names.A, - buttonImage: testConstants.images.A + value: testConstants.names.A }; } -function setupMocks(customMountOptions) { - const mountOptions = getMountOptions(customMountOptions); +function setupMocks(initialData = {}) { + const mountOptions = getMountOptions({ + router: { + navigate: jest.fn() + } + }); + + mountOptions.data = () => ( + initialData + ); const mockMixin = { methods: { @@ -58,7 +65,8 @@ describe('Payment Method Question', () => { // Arrange const props = generateDefaultProps(); const { wrapper } = setupMocks({ - propsData: props + propsData: props, + hasImage: true }); // Act