From 3be2e00ff88b8463ac3c3a2e7d8921718461bfb7 Mon Sep 17 00:00:00 2001 From: elweyn Date: Tue, 26 Jul 2022 16:42:13 +0200 Subject: [PATCH] Test that date is always createdAt --- .../Contributions/ContributionListItem.spec.js | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/frontend/src/components/Contributions/ContributionListItem.spec.js b/frontend/src/components/Contributions/ContributionListItem.spec.js index 20f4db959..08523cae4 100644 --- a/frontend/src/components/Contributions/ContributionListItem.spec.js +++ b/frontend/src/components/Contributions/ContributionListItem.spec.js @@ -13,6 +13,7 @@ describe('ContributionListItem', () => { const propsData = { id: 1, + createdAt: '26/07/2022', contributionDate: '07/06/2022', memo: 'Ich habe 10 Stunden die Elbwiesen von Müll befreit.', amount: '200', @@ -85,20 +86,8 @@ describe('ContributionListItem', () => { }) describe('contribution date', () => { - it('is contributionDate by default', () => { - expect(wrapper.vm.date).toBe(wrapper.vm.contributionDate) - }) - - it('is deletedAt when deletedAt is present', async () => { - const now = new Date().toISOString() - await wrapper.setProps({ deletedAt: now }) - expect(wrapper.vm.date).toBe(now) - }) - - it('is confirmedAt at when confirmedAt is present', async () => { - const now = new Date().toISOString() - await wrapper.setProps({ confirmedAt: now }) - expect(wrapper.vm.date).toBe(now) + it('is equal to createdAt', () => { + expect(wrapper.vm.date).toBe(wrapper.vm.createdAt) }) })