Test that date is always createdAt

This commit is contained in:
elweyn 2022-07-26 16:42:13 +02:00
parent 722886fedc
commit 3be2e00ff8

View File

@ -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)
})
})