Skip to content

Commit

Permalink
added karma mocks
Browse files Browse the repository at this point in the history
  • Loading branch information
Liza K committed Oct 30, 2019
1 parent 4e28d4e commit 6aea0e3
Showing 1 changed file with 36 additions and 5 deletions.
41 changes: 36 additions & 5 deletions src/legacy/ui/public/new_platform/new_platform.karma_mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@

import sinon from 'sinon';

const mockObservable = () => {
return {
subscribe: () => {}
};
};

export const npSetup = {
core: {
chrome: {}
Expand All @@ -39,6 +45,10 @@ export const npSetup = {
},
},
data: {
autocomplete: {
addProvider: sinon.fake(),
getProvider: sinon.fake(),
},
query: {
filterManager: sinon.fake(),
timefilter: {
Expand Down Expand Up @@ -79,6 +89,9 @@ export const npStart = {
registerType: sinon.fake(),
},
data: {
autocomplete: {
getProvider: sinon.fake(),
},
getSuggestions: sinon.fake(),
query: {
filterManager: {
Expand All @@ -90,13 +103,31 @@ export const npStart = {
addFilters: sinon.fake(),
setFilters: sinon.fake(),
removeAll: sinon.fake(),
getUpdates$: () => {
return {
subscribe: () => {}
};
},
getUpdates$: mockObservable,

},
timefilter: {
timefilter: {
getFetch$: mockObservable,
getAutoRefreshFetch$: mockObservable,
getEnabledUpdated$: mockObservable,
getTimeUpdate$: mockObservable,
getRefreshIntervalUpdate$: mockObservable,
isTimeRangeSelectorEnabled: sinon.fake(),
isAutoRefreshSelectorEnabled: sinon.fake(),
disableAutoRefreshSelector: sinon.fake(),
enableAutoRefreshSelector: sinon.fake(),
getRefreshInterval: sinon.fake(),
setRefreshInterval: sinon.fake(),
enableTimeRangeSelector: sinon.fake(),
getTime: sinon.fake(),
setTime: sinon.fake(),
getBounds: sinon.fake(),
calculateBounds: sinon.fake(),
createFilter: sinon.fake(),
},
history: sinon.fake(),
},
},
},
inspector: {
Expand Down

0 comments on commit 6aea0e3

Please sign in to comment.