Skip to content

Commit

Permalink
fix: adjust tests
Browse files Browse the repository at this point in the history
Signed-off-by: DorraJaouad <dorra.jaoued7@gmail.com>
  • Loading branch information
DorraJaouad committed Feb 14, 2024
1 parent 7d5853d commit 8f11a31
Showing 1 changed file with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,10 @@ describe('Reactions.vue', () => {
// Assert
expect(showError).toHaveBeenCalled()
expect(emojiPicker).toHaveLength(0)
expect(reactionButtons).toHaveLength(4) // "All" + "πŸŽ„" + "πŸ”₯" + "πŸ”’" buttons
expect(reactionButtons.at(1).text()).toBe('πŸŽ„ 2')
expect(reactionButtons.at(2).text()).toBe('πŸ”₯ 2')
expect(reactionButtons.at(3).text()).toBe('πŸ”’ 2')
expect(reactionButtons).toHaveLength(3) // "πŸŽ„" + "πŸ”₯" + "πŸ”’" buttons
expect(reactionButtons.at(0).text()).toBe('πŸŽ„ 2')
expect(reactionButtons.at(1).text()).toBe('πŸ”₯ 2')
expect(reactionButtons.at(2).text()).toBe('πŸ”’ 2')
})

test('doesn\'t mount emoji picker when there are no reactions', () => {
Expand Down Expand Up @@ -203,7 +203,10 @@ describe('Reactions.vue', () => {
vuexStore.dispatch('processMessage', { token, message })

const wrapper = shallowMount(Reactions, {
propsData: reactionsProps,
propsData: {
...reactionsProps,
isHovered: true,
},
localVue,
store,
stubs: {
Expand Down Expand Up @@ -255,8 +258,8 @@ describe('Reactions.vue', () => {

// Act
const reactionButtons = wrapper.findAllComponents(NcButton)
reactionButtons.at(1).vm.$emit('click') // πŸŽ„
reactionButtons.at(2).vm.$emit('click') // πŸ”₯
reactionButtons.at(0).vm.$emit('click') // πŸŽ„
reactionButtons.at(1).vm.$emit('click') // πŸ”₯

// Assert
expect(reactionsStore.addReactionToMessage).toHaveBeenCalledWith({
Expand Down

0 comments on commit 8f11a31

Please sign in to comment.