Fixes #14127 - TSVB should check id vis params instead of type (#14129)

* Fixes #14127 - TSVB should check id vis params instead of type

* Adding functional test from master
This commit is contained in:
Chris Cowan 2017-09-22 14:19:04 -07:00 committed by Court Ewing
parent b55100e46f
commit 864b8719e2
2 changed files with 49 additions and 1 deletions

View file

@ -45,7 +45,7 @@ app.controller('MetricsEditorController', (
// If the model doesn't exist we need to either intialize it with a copy from
// the $scope.vis._editableVis.params or create a new panel all together.
if (!$scope.model) {
if ($scope.vis._editableVis.params.type) {
if ($scope.vis._editableVis.params.id) {
$scope.model = _.assign({}, $scope.vis._editableVis.params);
} else {
$scope.model = createNewPanel();

View file

@ -0,0 +1,48 @@
import expect from 'expect.js';
export default function ({ getService, getPageObjects }) {
const log = getService('log');
const PageObjects = getPageObjects(['common', 'visualize', 'header', 'settings', 'visualBuilder']);
describe('visualize app', function describeIndexTests() {
before(function () {
const fromTime = '2015-09-19 06:31:44.000';
const toTime = '2015-09-22 18:31:44.000';
log.debug('navigateToApp visualize');
return PageObjects.common.navigateToUrl('visualize', 'new')
.then(function () {
log.debug('clickVisualBuilderChart');
return PageObjects.visualize.clickVisualBuilder();
})
.then(function setAbsoluteRange() {
log.debug('Set absolute time range from \"' + fromTime + '\" to \"' + toTime + '\"');
return PageObjects.header.setAbsoluteRange(fromTime, toTime);
})
.then(function () {
return PageObjects.header.waitUntilLoadingHasFinished();
})
.then(function sleep() {
return PageObjects.common.sleep(1003);
})
.then(function clickMetric() {
return PageObjects.visualBuilder.clickMetric();
});
});
describe('Visual Builder chart', function indexPatternCreation() {
it('should show correct data', function () {
const expectedMetricValue = '156';
return PageObjects.visualBuilder.getMetricValue()
.then(function (value) {
log.debug(`metric value: ${value}`);
expect(value).to.eql(expectedMetricValue);
});
});
});
});
}