wallet frontend: add tests for ContributionMessagesListItem

This commit is contained in:
mahula 2022-10-06 10:14:36 +02:00
parent d37b8d3e50
commit 1bd90cf427

View File

@ -97,6 +97,30 @@ describe('ContributionMessagesListItem', () => {
it('has a DIV .is-moderator.text-left', () => {
expect(wrapper.find('div.is-moderator.text-left').exists()).toBe(true)
})
it('has the complete user name', () => {
expect(wrapper.find('div.is-moderator.text-left > span:nth-child(2)').text()).toBe(
'Bibi Bloxberg',
)
})
it('has the message creation date', () => {
expect(wrapper.find('div.is-moderator.text-left > span:nth-child(3)').text()).toBe(
'Mon Aug 29 2022 12:25:34 GMT+0000 (Koordinierte Weltzeit)',
)
})
it('has the moderator label', () => {
expect(wrapper.find('div.is-moderator.text-left > small:nth-child(4)').text()).toBe(
'community.moderator',
)
})
it('has the message', () => {
expect(wrapper.find('div.is-moderator.text-left > div:nth-child(5)').text()).toBe(
'Asda sdad ad asdasd, das Ass das Das.',
)
})
})
})
@ -131,6 +155,24 @@ describe('ContributionMessagesListItem', () => {
it('has a DIV .is-not-moderator.text-right', () => {
expect(wrapper.find('div.is-not-moderator.text-right').exists()).toBe(true)
})
it('has the complete user name', () => {
expect(wrapper.find('div.is-not-moderator.text-right > span:nth-child(2)').text()).toBe(
'Peter Lustig',
)
})
it('has the message creation date', () => {
expect(wrapper.find('div.is-not-moderator.text-right > span:nth-child(3)').text()).toBe(
'Mon Aug 29 2022 12:23:27 GMT+0000 (Koordinierte Weltzeit)',
)
})
it('has the message', () => {
expect(wrapper.find('div.is-not-moderator.text-right > div:nth-child(4)').text()).toBe(
'Lorem ipsum?',
)
})
})
})
})