Skip to content

Commit

Permalink
Fix jest test
Browse files Browse the repository at this point in the history
  • Loading branch information
Liza K committed Sep 4, 2019
1 parent b579701 commit f7adb55
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { TimeRange } from 'src/plugins/data/public';
import { PersistedLog } from 'ui/persisted_log';

export class TimeHistory {
private history: PersistedLog;
private history: PersistedLog<TimeRange>;

constructor() {
const historyOptions = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { TimeRange } from 'src/plugins/data/public';
import { ViewMode } from '../../../embeddable_api/public/np_ready/public';

import { dataPluginMock } from '../../../../core_plugins/data/public/mocks';
import { InputTimeRange } from 'ui/timefilter';
const dataSetupMock = dataPluginMock.createSetup();

describe('DashboardState', function() {
Expand All @@ -36,11 +37,8 @@ describe('DashboardState', function() {
let mockTime: TimeRange = { to: 'now', from: 'now-15m' };
const mockTimefilter = dataSetupMock.timefilter!.timefilter;

mockTimefilter.setTime.mockImplementation((time: any) => {
mockTime = {
from: time.from.toISOString(),
to: time.to.toISOString(),
};
mockTimefilter.setTime.mockImplementation((time: InputTimeRange) => {
mockTime = time as TimeRange;
});
mockTimefilter.getTime.mockImplementation(() => {
return mockTime;
Expand Down

0 comments on commit f7adb55

Please sign in to comment.