-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
76 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
## index pattern field editor example | ||
|
||
This example index pattern field editor app shows how to: | ||
- TODO | ||
- Edit index pattern fields via flyout | ||
- Delete index pattern runtime fields with modal confirm prompt | ||
|
||
To run this example, use the command `yarn start --run-examples`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 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. | ||
*/ | ||
|
||
import { PluginFunctionalProviderContext } from 'test/plugin_functional/services'; | ||
|
||
// eslint-disable-next-line import/no-default-export | ||
export default function ({ | ||
getService, | ||
getPageObjects, | ||
loadTestFile, | ||
}: PluginFunctionalProviderContext) { | ||
const browser = getService('browser'); | ||
const es = getService('es'); | ||
const PageObjects = getPageObjects(['common', 'header', 'settings']); | ||
|
||
describe('index pattern field editor example', function () { | ||
this.tags('ciGroup2'); | ||
before(async () => { | ||
await browser.setWindowSize(1300, 900); | ||
await es.transport.request({ | ||
path: '/blogs/_doc', | ||
method: 'POST', | ||
body: { user: 'matt', message: 20 }, | ||
}); | ||
|
||
await PageObjects.settings.navigateTo(); | ||
await PageObjects.settings.createIndexPattern('blogs', null); | ||
await PageObjects.common.navigateToApp('indexPatternFieldEditorExample'); | ||
}); | ||
|
||
loadTestFile(require.resolve('./index_pattern_field_editor_example')); | ||
}); | ||
} |
26 changes: 26 additions & 0 deletions
26
test/examples/index_pattern_field_editor_example/index_pattern_field_editor_example.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 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. | ||
*/ | ||
|
||
import expect from '@kbn/expect'; | ||
|
||
import { PluginFunctionalProviderContext } from 'test/plugin_functional/services'; | ||
|
||
// eslint-disable-next-line import/no-default-export | ||
export default function ({ getService }: PluginFunctionalProviderContext) { | ||
const testSubjects = getService('testSubjects'); | ||
|
||
describe('', () => { | ||
it('finds an index pattern', async () => { | ||
await testSubjects.existOrFail('indexPatternTitle'); | ||
}); | ||
it('opens the field editor', async () => { | ||
await testSubjects.click('addField'); | ||
await testSubjects.existOrFail('flyoutTitle'); | ||
}); | ||
}); | ||
} |