feat: Display "Snoozed Until" time on conversation header (#3028)

This commit is contained in:
Pranav Raj S 2021-09-29 19:33:51 +05:30 committed by GitHub
parent 49ac4a4400
commit 57abdc4d5f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 217 additions and 172 deletions

View file

@ -1,6 +1,7 @@
import { createLocalVue, mount } from '@vue/test-utils';
import Vuex from 'vuex';
import VueI18n from 'vue-i18n';
import VTooltip from 'v-tooltip';
import Button from 'dashboard/components/buttons/Button';
import i18n from 'dashboard/i18n';
@ -10,6 +11,7 @@ import MoreActions from '../MoreActions';
const localVue = createLocalVue();
localVue.use(Vuex);
localVue.use(VueI18n);
localVue.use(VTooltip);
localVue.component('woot-button', Button);
@ -63,21 +65,9 @@ describe('MoveActions', () => {
moreActions = mount(MoreActions, { store, localVue, i18n: i18nConfig });
});
it('opens the menu when user clicks "more"', async () => {
expect(moreActions.find('.dropdown-pane').exists()).toBe(false);
await moreActions.find('.more--button').trigger('click');
expect(moreActions.find('.dropdown-pane').exists()).toBe(true);
});
describe('muting discussion', () => {
it('triggers "muteConversation"', async () => {
await moreActions.find('.more--button').trigger('click');
await moreActions
.find('.dropdown-pane button:first-child')
.trigger('click');
await moreActions.find('button:first-child').trigger('click');
expect(muteConversation).toBeCalledWith(
expect.any(Object),
@ -87,11 +77,7 @@ describe('MoveActions', () => {
});
it('shows alert', async () => {
await moreActions.find('.more--button').trigger('click');
await moreActions
.find('.dropdown-pane button:first-child')
.trigger('click');
await moreActions.find('button:first-child').trigger('click');
expect(window.bus.$emit).toBeCalledWith(
'newToastMessage',
@ -106,11 +92,7 @@ describe('MoveActions', () => {
});
it('triggers "unmuteConversation"', async () => {
await moreActions.find('.more--button').trigger('click');
await moreActions
.find('.dropdown-pane button:first-child')
.trigger('click');
await moreActions.find('button:first-child').trigger('click');
expect(unmuteConversation).toBeCalledWith(
expect.any(Object),
@ -120,11 +102,7 @@ describe('MoveActions', () => {
});
it('shows alert', async () => {
await moreActions.find('.more--button').trigger('click');
await moreActions
.find('.dropdown-pane button:first-child')
.trigger('click');
await moreActions.find('button:first-child').trigger('click');
expect(window.bus.$emit).toBeCalledWith(
'newToastMessage',