From 4aa531611023dac4521dd97924b56e20569f142c Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Sat, 2 Oct 2021 19:15:57 +0200 Subject: [PATCH] fix tests to use enum definitions --- frontend/src/components/TransactionCollapse.spec.js | 10 +++++----- .../Pages/AccountOverview/GdtTransactionList.spec.js | 9 +++++---- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/frontend/src/components/TransactionCollapse.spec.js b/frontend/src/components/TransactionCollapse.spec.js index 8cb84f7a2..198ce2780 100644 --- a/frontend/src/components/TransactionCollapse.spec.js +++ b/frontend/src/components/TransactionCollapse.spec.js @@ -32,8 +32,8 @@ describe('TransactionCollapse', () => { expect(wrapper.find('div.gdt-transaction-collapse').exists()).toBeTruthy() }) - it('checks the prop gdtEntryType ', () => { - expect(wrapper.props().gdtEntryType).toBe(1) + it('checks the prop gdtEntryType', () => { + expect(wrapper.props().gdtEntryType).toBe('FORM') }) it('renders the component collapse-header', () => { @@ -78,7 +78,7 @@ describe('TransactionCollapse', () => { }) it('checks the prop gdtEntryType', () => { - expect(wrapper.props().gdtEntryType).toBe(7) + expect(wrapper.props().gdtEntryType).toBe('GLOBAL_MODIFICATOR') }) it('renders the component collapse-header', () => { @@ -122,8 +122,8 @@ describe('TransactionCollapse', () => { expect(wrapper.find('div.gdt-transaction-collapse').exists()).toBeTruthy() }) - it('checks the prop gdtEntryType ', () => { - expect(wrapper.props().gdtEntryType).toBe(4) + it('checks the prop gdtEntryType', () => { + expect(wrapper.props().gdtEntryType).toBe('ELOPAGE_PUBLISHER') }) it('renders the component collapse-header', () => { diff --git a/frontend/src/views/Pages/AccountOverview/GdtTransactionList.spec.js b/frontend/src/views/Pages/AccountOverview/GdtTransactionList.spec.js index 8d06de5c6..fcecf63fa 100644 --- a/frontend/src/views/Pages/AccountOverview/GdtTransactionList.spec.js +++ b/frontend/src/views/Pages/AccountOverview/GdtTransactionList.spec.js @@ -1,4 +1,5 @@ import { mount } from '@vue/test-utils' +import { GdtEntryType } from '../../../graphql/enums' import GdtTransactionList from './GdtTransactionList' const localVue = global.localVue @@ -14,7 +15,7 @@ const apolloMock = jest.fn().mockResolvedValue({ factor: 17, comment: '', date: '2021-05-02T17:20:11+00:00', - gdtEntryType: 1, + gdtEntryType: GdtEntryType.FORM, }, { amount: 1810, @@ -22,7 +23,7 @@ const apolloMock = jest.fn().mockResolvedValue({ factor: 0.2, comment: 'Dezember 20', date: '2020-12-31T12:00:00+00:00', - gdtEntryType: 7, + gdtEntryType: GdtEntryType.GLOBAL_MODIFICATOR, }, { amount: 100, @@ -30,7 +31,7 @@ const apolloMock = jest.fn().mockResolvedValue({ factor: 17, comment: '', date: '2020-05-07T17:00:00+00:00', - gdtEntryType: 1, + gdtEntryType: GdtEntryType.FORM, }, { amount: 100, @@ -38,7 +39,7 @@ const apolloMock = jest.fn().mockResolvedValue({ factor: 22, comment: '', date: '2020-04-10T13:28:00+00:00', - gdtEntryType: 4, + gdtEntryType: GdtEntryType.ELOPAGE_PUBLISHER, }, ], },