2020-02-20 00:06:01 +01:00
|
|
|
/*
|
2021-01-20 02:54:11 +01:00
|
|
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
|
|
* or more contributor license agreements. Licensed under the Elastic License
|
2021-02-04 03:39:13 +01:00
|
|
|
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
|
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
|
|
* Side Public License, v 1.
|
2020-02-20 00:06:01 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
import expect from '@kbn/expect';
|
|
|
|
import { PluginFunctionalProviderContext } from 'test/plugin_functional/services';
|
|
|
|
|
|
|
|
// eslint-disable-next-line import/no-default-export
|
2020-05-22 10:08:13 +02:00
|
|
|
export default function ({ getService }: PluginFunctionalProviderContext) {
|
2020-02-20 00:06:01 +01:00
|
|
|
const testSubjects = getService('testSubjects');
|
2020-04-15 20:12:42 +02:00
|
|
|
const flyout = getService('flyout');
|
2020-02-20 00:06:01 +01:00
|
|
|
|
2021-04-19 22:02:15 +02:00
|
|
|
describe('adding children', () => {
|
2020-02-20 00:06:01 +01:00
|
|
|
before(async () => {
|
2020-06-16 10:43:29 +02:00
|
|
|
await testSubjects.click('embeddablePanelExample');
|
2020-02-20 00:06:01 +01:00
|
|
|
});
|
|
|
|
|
2020-04-15 20:12:42 +02:00
|
|
|
it('Can add a child backed off a saved object', async () => {
|
|
|
|
await testSubjects.click('embeddablePanelToggleMenuIcon');
|
|
|
|
await testSubjects.click('embeddablePanelAction-ACTION_ADD_PANEL');
|
2020-06-16 12:31:55 +02:00
|
|
|
await testSubjects.waitForDeleted('savedObjectFinderLoadingIndicator');
|
2020-04-15 20:12:42 +02:00
|
|
|
await testSubjects.click('savedObjectTitleGarbage');
|
|
|
|
await testSubjects.moveMouseTo('euiFlyoutCloseButton');
|
|
|
|
await flyout.ensureClosed('dashboardAddPanel');
|
|
|
|
const tasks = await testSubjects.getVisibleTextAll('todoEmbeddableTask');
|
2021-04-19 22:02:15 +02:00
|
|
|
expect(tasks).to.eql(['Goes out on Wednesdays!', 'Take the garbage out']);
|
2020-04-15 20:12:42 +02:00
|
|
|
});
|
2020-02-20 00:06:01 +01:00
|
|
|
});
|
|
|
|
}
|