fix for chart_types test (#57056) (#57128)

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
Rashmi Kulkarni 2020-02-07 10:24:15 -08:00 committed by GitHub
parent a529fc9a76
commit 359d531168
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -17,6 +17,7 @@
* under the License.
*/
import _ from 'lodash';
import expect from '@kbn/expect';
import { FtrProviderContext } from '../../ftr_provider_context';
@ -34,7 +35,7 @@ export default function({ getService, getPageObjects }: FtrProviderContext) {
});
it('should show the correct chart types', async function() {
const expectedChartTypes = [
let expectedChartTypes = [
'Area',
'Controls',
'Coordinate Map',
@ -55,13 +56,19 @@ export default function({ getService, getPageObjects }: FtrProviderContext) {
'Vertical Bar',
];
if (!isOss) {
expectedChartTypes.push('Maps');
expectedChartTypes.push('Maps', 'Lens');
expectedChartTypes = _.remove(expectedChartTypes, function(n) {
return n !== 'Coordinate Map';
});
expectedChartTypes = _.remove(expectedChartTypes, function(n) {
return n !== 'Region Map';
});
expectedChartTypes.sort();
}
log.debug('oss= ' + isOss);
// find all the chart types and make sure there all there
const chartTypes = await PageObjects.visualize.getChartTypes();
const chartTypes = (await PageObjects.visualize.getChartTypes()).sort();
log.debug('returned chart types = ' + chartTypes);
log.debug('expected chart types = ' + expectedChartTypes);
expect(chartTypes).to.eql(expectedChartTypes);