-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into automated-in-all-rules
- Loading branch information
Showing
147 changed files
with
3,848 additions
and
1,550 deletions.
There are no files selected for viewing
71 changes: 71 additions & 0 deletions
71
test/functional/apps/dashboard/group5/dashboard_panel_listing.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,71 @@ | ||
/* | ||
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public | ||
* License v3.0 only", or the "Server Side Public License, v 1". | ||
*/ | ||
|
||
import expect from '@kbn/expect'; | ||
|
||
import { FtrProviderContext } from '../../../ftr_provider_context'; | ||
|
||
export default function ({ getService, getPageObjects }: FtrProviderContext) { | ||
const PageObjects = getPageObjects(['dashboard', 'header', 'visualize', 'settings', 'common']); | ||
const testSubjects = getService('testSubjects'); | ||
const kibanaServer = getService('kibanaServer'); | ||
const dashboardAddPanel = getService('dashboardAddPanel'); | ||
|
||
describe('dashboard panel listing', () => { | ||
before(async () => { | ||
await kibanaServer.savedObjects.cleanStandardList(); | ||
await kibanaServer.importExport.load( | ||
'test/functional/fixtures/kbn_archiver/dashboard/current/kibana' | ||
); | ||
await kibanaServer.uiSettings.replace({ | ||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', | ||
}); | ||
}); | ||
|
||
after(async () => { | ||
await kibanaServer.savedObjects.cleanStandardList(); | ||
}); | ||
|
||
it('renders a panel with predefined order of panel groups', async () => { | ||
await PageObjects.dashboard.navigateToApp(); | ||
await PageObjects.dashboard.clickNewDashboard(); | ||
await PageObjects.dashboard.switchToEditMode(); | ||
|
||
await dashboardAddPanel.clickEditorMenuButton(); | ||
|
||
const panelSelectionList = await testSubjects.find('dashboardPanelSelectionList'); | ||
|
||
const panelGroupByOrder = new Map(); | ||
|
||
const panelGroups = await panelSelectionList.findAllByCssSelector( | ||
'[data-test-subj*="dashboardEditorMenu-"]' | ||
); | ||
|
||
for (let i = 0; i < panelGroups.length; i++) { | ||
const panelGroup = panelGroups[i]; | ||
const order = await panelGroup.getAttribute('data-group-sort-order'); | ||
// @ts-ignore | ||
const [, panelGroupTitle] = (await panelGroup.getAttribute('data-test-subj'))?.match( | ||
/dashboardEditorMenu-(.*)/ | ||
); | ||
|
||
panelGroupByOrder.set(order, panelGroupTitle); | ||
} | ||
|
||
expect(panelGroupByOrder.size).to.eql(4); | ||
|
||
expect([...panelGroupByOrder.values()]).to.eql([ | ||
'visualizationsGroup', | ||
'annotation-and-navigationGroup', | ||
'observabilityGroup', | ||
'legacyGroup', | ||
]); | ||
}); | ||
}); | ||
} |
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
Oops, something went wrong.