diff options
author | marco <marcoambrosini@pm.me> | 2022-03-15 17:57:34 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2022-03-21 14:08:25 +0300 |
commit | 83900e1cf065eb068d6c4bccaeadae72b185e506 (patch) | |
tree | 4cc13844c924cbc3da7b0c9de16f3f54bb1dc267 /src/components/MessagesList/MessagesGroup/Message | |
parent | b3ea65f6d10cfc0dfc726f30782121689cdb20f1 (diff) |
Add some required props to the tests
Signed-off-by: marco <marcoambrosini@pm.me>
Diffstat (limited to 'src/components/MessagesList/MessagesGroup/Message')
-rw-r--r-- | src/components/MessagesList/MessagesGroup/Message/MessageButtonsBar/MessageButtonsBar.spec.js | 48 |
1 files changed, 21 insertions, 27 deletions
diff --git a/src/components/MessagesList/MessagesGroup/Message/MessageButtonsBar/MessageButtonsBar.spec.js b/src/components/MessagesList/MessagesGroup/Message/MessageButtonsBar/MessageButtonsBar.spec.js index eeff13add..d14ba74b9 100644 --- a/src/components/MessagesList/MessagesGroup/Message/MessageButtonsBar/MessageButtonsBar.spec.js +++ b/src/components/MessagesList/MessagesGroup/Message/MessageButtonsBar/MessageButtonsBar.spec.js @@ -51,6 +51,13 @@ describe('MessageButtonsBar.vue', () => { token: TOKEN, systemMessage: '', messageType: 'comment', + previousMessageId: 100, + messageObject: {}, + participant: { + actorId: 'user-id-1', + actorType: ATTENDEE.ACTOR_TYPE.USERS, + participantType: PARTICIPANT.TYPE.USER, + }, } }) @@ -95,6 +102,7 @@ describe('MessageButtonsBar.vue', () => { systemMessage: '', timestamp: new Date('2020-05-07 09:23:00').getTime() / 1000, token: TOKEN, + previousMessageId: 12, }) }) @@ -265,11 +273,7 @@ describe('MessageButtonsBar.vue', () => { jest.spyOn(global.Date, 'now') .mockImplementation(() => mockDate) - messageProps.participant = { - actorId: 'user-id-1', - actorType: ATTENDEE.ACTOR_TYPE.USERS, - participantType, - } + messageProps.participant.participantType = participantType const wrapper = shallowMount(MessageButtonsBar, { localVue, @@ -342,6 +346,11 @@ describe('MessageButtonsBar.vue', () => { // appears even with more restrictive conditions conversationProps.readOnly = CONVERSATION.STATE.READ_ONLY messageProps.actorId = 'another-user' + messageProps.participant = { + actorId: 'guest-id-1', + actorType: ATTENDEE.ACTOR_TYPE.GUESTS, + participantType: PARTICIPANT.TYPE.GUEST, + } const wrapper = shallowMount(MessageButtonsBar, { localVue, @@ -349,17 +358,7 @@ describe('MessageButtonsBar.vue', () => { stubs: { ActionButton, }, - mixins: [{ - computed: { - participant: () => { - return { - actorId: 'guest-id-1', - actorType: ATTENDEE.ACTOR_TYPE.GUESTS, - participantType: PARTICIPANT.TYPE.GUEST, - } - }, - }, - }], + propsData: messageProps, }) @@ -388,6 +387,11 @@ describe('MessageButtonsBar.vue', () => { // appears even with more restrictive conditions conversationProps.readOnly = CONVERSATION.STATE.READ_ONLY messageProps.actorId = 'another-user' + messageProps.participant = { + actorId: 'guest-id-1', + actorType: ATTENDEE.ACTOR_TYPE.GUESTS, + participantType: PARTICIPANT.TYPE.GUEST, + } const wrapper = shallowMount(MessageButtonsBar, { localVue, @@ -398,17 +402,7 @@ describe('MessageButtonsBar.vue', () => { stubs: { ActionButton, }, - mixins: [{ - computed: { - participant: () => { - return { - actorId: 'guest-id-1', - actorType: ATTENDEE.ACTOR_TYPE.GUESTS, - participantType: PARTICIPANT.TYPE.GUEST, - } - }, - }, - }], + propsData: messageProps, }) |