Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kertal committed Mar 17, 2020
1 parent 6bb657e commit 2877557
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,22 +73,7 @@ describe('discover field chooser directives', function() {
beforeEach(() => pluginInstance.initializeServices());
beforeEach(() => pluginInstance.initializeInnerAngular());

beforeEach(
ngMock.module('app/discover', $provide => {
$provide.decorator('config', $delegate => {
// disable shortDots for these tests
$delegate.get = _.wrap($delegate.get, function(origGet, name) {
if (name === 'shortDots:enable') {
return false;
} else {
return origGet.call(this, name);
}
});

return $delegate;
});
})
);
beforeEach(ngMock.module('app/discover'));

beforeEach(
ngMock.inject(function(Private) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logsta
describe('Doc Table', function() {
let $parentScope;
let $scope;
let config;

// Stub out a minimal mapping of 4 fields
let mapping;
Expand All @@ -41,8 +40,7 @@ describe('Doc Table', function() {
beforeEach(() => pluginInstance.initializeInnerAngular());
beforeEach(ngMock.module('app/discover'));
beforeEach(
ngMock.inject(function(_config_, $rootScope, Private) {
config = _config_;
ngMock.inject(function($rootScope, Private) {
$parentScope = $rootScope;
$parentScope.indexPattern = Private(FixturesStubbedLogstashIndexPatternProvider);
mapping = $parentScope.indexPattern.fields;
Expand Down Expand Up @@ -144,12 +142,6 @@ describe('Doc Table', function() {
filter: sinon.spy(),
maxLength: 50,
});

// Ignore the metaFields (_id, _type, etc) since we don't have a mapping for them
sinon
.stub(config, 'get')
.withArgs('metaFields')
.returns([]);
});
afterEach(function() {
destroy();
Expand Down Expand Up @@ -215,10 +207,11 @@ describe('Doc Table', function() {
maxLength: 50,
});

/**
sinon
.stub(config, 'get')
.withArgs('metaFields')
.returns(['_id']);
.returns(['_id']); **/

// Open the row
$scope.toggleRow();
Expand Down

0 comments on commit 2877557

Please sign in to comment.