it('calls TOGGLE_EMOTION when clicked', () => { const wrapper = Wrapper() happyEmotionButton = wrapper.findAll('.emotion-button > .base-button').at(1) happyEmotionButton.trigger('click') expect(mutations['posts/TOGGLE_EMOTION']).toHaveBeenCalledWith({}, 'happy') getters['posts/filteredByEmotions'] = jest.fn(() => ['happy']) const wrapper = Wrapper() happyEmotionButton = wrapper.findAll('.emotion-button > .base-button').at(1) const happyEmotionButtonImage = happyEmotionButton.find('img') expect(happyEmotionButtonImage.attributes().src).toEqual('/img/svg/emoji/happy_color.svg')
expect( wrapper .findAll('.ds-menu-item') .filter((item) => item.text() === 'settings.name') .at(0) }) wrapper .findAll('.ds-menu-item') .filter((item) => item.text() === 'settings.muted-users.mute') .at(0) }) wrapper .findAll('.ds-menu-item') .filter((item) => item.text() === 'settings.muted-users.unmute') .at(0)
openModalSpy = jest.spyOn(wrapper.vm, 'openModal') wrapper .findAll('.ds-menu-item') .filter((item) => item.text() === 'report.contribution.title') .at(0) openModalSpy = jest.spyOn(wrapper.vm, 'openModal') wrapper .findAll('.ds-menu-item') .filter((item) => item.text() === 'report.comment.title') .at(0) openModalSpy = jest.spyOn(wrapper.vm, 'openModal') wrapper .findAll('.ds-menu-item') .filter((item) => item.text() === 'report.user.title') .at(0) openModalSpy = jest.spyOn(wrapper.vm, 'openModal') wrapper .findAll('.ds-menu-item') .filter((item) => item.text() === 'report.organization.title') .at(0)
expect(wrapper.findAll('.user-teaser')).toHaveLength(user.following.length) expect(wrapper.emitted('fetchAllConnections')).toEqual([['following']]) }) expect(wrapper.findAll('.user-teaser')).toHaveLength(user.followedBy.length) expect(wrapper.emitted('fetchAllConnections')).toEqual([['followedBy']]) }) expect(wrapper.findAll('.user-teaser')).toHaveLength(user.following.length) }) expect(wrapper.findAll('.user-teaser')).toHaveLength(allConnectionsUser.followingCount) })
const wrapper = Wrapper() spanishButton = wrapper .findAll('.languages-filter .item .base-button') .at(languages.findIndex((l) => l.code === 'es')) expect(spanishButton.attributes().class).toContain('--filled') const wrapper = Wrapper() englishButton = wrapper .findAll('.languages-filter .item .base-button') .at(languages.findIndex((l) => l.code === 'en')) englishButton.trigger('click')
}) wrapper .findAll('.ds-menu-item') .filter((item) => item.text() === 'post.menu.pin') .at(0) }) wrapper .findAll('.ds-menu-item') .filter((item) => item.text() === 'post.menu.unpin') .at(0) }) wrapper .findAll('.ds-menu-item') .filter((item) => item.text() === 'settings.deleteUserAccount.name') .at(0) expect( wrapper .findAll('.ds-menu-item') .filter((item) => item.text() === 'settings.deleteUserAccount.name'), ).toEqual({})
openModalSpy = jest.spyOn(wrapper.vm, 'openModal') wrapper .findAll('.ds-menu-item') .filter((item) => item.text() === 'disable.contribution.title') .at(0) openModalSpy = jest.spyOn(wrapper.vm, 'openModal') wrapper .findAll('.ds-menu-item') .filter((item) => item.text() === 'disable.comment.title') .at(0) openModalSpy = jest.spyOn(wrapper.vm, 'openModal') wrapper .findAll('.ds-menu-item') .filter((item) => item.text() === 'disable.user.title') .at(0) openModalSpy = jest.spyOn(wrapper.vm, 'openModal') wrapper .findAll('.ds-menu-item') .filter((item) => item.text() === 'disable.organization.title') .at(0) openModalSpy = jest.spyOn(wrapper.vm, 'openModal') wrapper .findAll('.ds-menu-item') .filter((item) => item.text() === 'release.contribution.title') .at(0)