mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Updating tests to reflect the new reality of histogram having a default value
This commit is contained in:
parent
0e4270a53b
commit
c300c1486f
2 changed files with 21 additions and 19 deletions
|
@ -25,21 +25,23 @@ define(function (require) {
|
|||
// of defaults (not sure why a someone define more...
|
||||
// but whatever). Also if a schema.name is already set then don't
|
||||
// set anything.
|
||||
_(vis.type.schemas.all)
|
||||
.filter(function (schema) {
|
||||
return _.isArray(schema.defaults) && schema.defaults.length > 0;
|
||||
})
|
||||
.each(function (schema) {
|
||||
if (!self.bySchemaName[schema.name]) {
|
||||
var defaults = schema.defaults.slice(0, schema.max);
|
||||
_.each(defaults, function (def) {
|
||||
self.push(new AggConfig(vis, {
|
||||
schema: schema.name,
|
||||
type: def
|
||||
}));
|
||||
});
|
||||
}
|
||||
});
|
||||
if (vis && vis.type && vis.type.schemas && vis.type.schemas.all) {
|
||||
_(vis.type.schemas.all)
|
||||
.filter(function (schema) {
|
||||
return _.isArray(schema.defaults) && schema.defaults.length > 0;
|
||||
})
|
||||
.each(function (schema) {
|
||||
if (!self.bySchemaName[schema.name]) {
|
||||
var defaults = schema.defaults.slice(0, schema.max);
|
||||
_.each(defaults, function (def) {
|
||||
self.push(new AggConfig(vis, {
|
||||
schema: schema.name,
|
||||
type: def
|
||||
}));
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ define(function (require) {
|
|||
});
|
||||
|
||||
var ac = new AggConfigs(vis);
|
||||
expect(ac).to.have.length(0);
|
||||
expect(ac).to.have.length(1);
|
||||
});
|
||||
|
||||
it('converts configStates into AggConfig objects if they are not already', function () {
|
||||
|
@ -60,8 +60,8 @@ define(function (require) {
|
|||
})
|
||||
]);
|
||||
|
||||
expect(ac).to.have.length(2);
|
||||
expect(SpiedAggConfig).to.have.property('callCount', 1);
|
||||
expect(ac).to.have.length(3);
|
||||
expect(SpiedAggConfig).to.have.property('callCount', 3);
|
||||
});
|
||||
|
||||
describe('defaults', function () {
|
||||
|
@ -187,7 +187,7 @@ define(function (require) {
|
|||
}
|
||||
}(vis.aggs.toDsl()));
|
||||
|
||||
expect(aggInfos).to.have.length(0);
|
||||
expect(aggInfos).to.have.length(1);
|
||||
});
|
||||
|
||||
it('skips aggs that don\'t have a dsl representation', function () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue