Skip to content

Commit

Permalink
Fixing test
Browse files Browse the repository at this point in the history
  • Loading branch information
ymao1 committed Nov 17, 2020
1 parent 2b1b9ef commit 5a3aa75
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { encryptedSavedObjectsMock } from '../../../../encrypted_saved_objects/s
import { actionsAuthorizationMock } from '../../../../actions/server/mocks';
import { AlertsAuthorization } from '../../authorization/alerts_authorization';
import { ActionsAuthorization } from '../../../../actions/server';
import { getBeforeSetup } from './lib';
import { getBeforeSetup, setGlobalDate } from './lib';

const taskManager = taskManagerMock.createStart();
const alertTypeRegistry = alertTypeRegistryMock.create();
Expand Down Expand Up @@ -43,6 +43,8 @@ beforeEach(() => {
getBeforeSetup(alertsClientParams, taskManager, alertTypeRegistry);
});

setGlobalDate();

describe('muteAll()', () => {
test('mutes an alert', async () => {
const alertsClient = new AlertsClient(alertsClientParams);
Expand Down Expand Up @@ -74,6 +76,7 @@ describe('muteAll()', () => {
{
muteAll: true,
mutedInstanceIds: [],
updatedAt: '2019-02-12T21:01:22.479Z',
updatedBy: 'elastic',
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { encryptedSavedObjectsMock } from '../../../../encrypted_saved_objects/s
import { actionsAuthorizationMock } from '../../../../actions/server/mocks';
import { AlertsAuthorization } from '../../authorization/alerts_authorization';
import { ActionsAuthorization } from '../../../../actions/server';
import { getBeforeSetup } from './lib';
import { getBeforeSetup, setGlobalDate } from './lib';

const taskManager = taskManagerMock.createStart();
const alertTypeRegistry = alertTypeRegistryMock.create();
Expand Down Expand Up @@ -44,6 +44,8 @@ beforeEach(() => {
getBeforeSetup(alertsClientParams, taskManager, alertTypeRegistry);
});

setGlobalDate();

describe('unmuteAll()', () => {
test('unmutes an alert', async () => {
const alertsClient = new AlertsClient(alertsClientParams);
Expand Down Expand Up @@ -75,6 +77,7 @@ describe('unmuteAll()', () => {
{
muteAll: false,
mutedInstanceIds: [],
updatedAt: '2019-02-12T21:01:22.479Z',
updatedBy: 'elastic',
},
{
Expand Down

0 comments on commit 5a3aa75

Please sign in to comment.