mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[ACA-20] Sidenav - navigate to first child route when expanded for the first time (#798)
* bradcrumb root title * use correct i18n string reference * expansion panel state directive * takeUntil * fix text * parameter type * fix title error message reference * fix My Libraries test and add separate one for Favourite Libraries
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
*/
|
||||
|
||||
import { ElementFinder, ElementArrayFinder, by, element } from 'protractor';
|
||||
import { SIDEBAR_LABELS } from '../../configs';
|
||||
import { Menu } from '../menu/menu';
|
||||
import { Component } from '../component';
|
||||
import { Utils } from '../../utilities/utils';
|
||||
@@ -101,6 +102,10 @@ export class Sidenav extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
async isFileLibrariesMenuExpanded() {
|
||||
return await element(by.cssContainingText('.mat-expanded', SIDEBAR_LABELS.FILE_LIBRARIES)).isPresent();
|
||||
}
|
||||
|
||||
async expandMenu(label: string) {
|
||||
try{
|
||||
|
||||
@@ -117,4 +122,5 @@ export class Sidenav extends Component {
|
||||
console.log('---- sidebar navigation catch expandMenu: ', e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -63,6 +63,17 @@ export class BrowsingPage extends Page {
|
||||
await this.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.MY_LIBRARIES);
|
||||
}
|
||||
|
||||
async clickFavoriteLibraries() {
|
||||
await this.sidenav.expandMenu(SIDEBAR_LABELS.FILE_LIBRARIES);
|
||||
await this.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.FAVORITE_LIBRARIES);
|
||||
}
|
||||
|
||||
async clickMyLibraries() {
|
||||
if ( !(await this.sidenav.isFileLibrariesMenuExpanded()) ) {
|
||||
await this.sidenav.expandMenu(SIDEBAR_LABELS.FILE_LIBRARIES);
|
||||
}
|
||||
await this.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.MY_LIBRARIES);
|
||||
}
|
||||
|
||||
async clickRecentFilesAndWait() {
|
||||
await this.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.RECENT_FILES);
|
||||
|
@@ -89,10 +89,16 @@ describe('Breadcrumb', () => {
|
||||
expect(await breadcrumb.getCurrentItemName()).toBe('Personal Files');
|
||||
});
|
||||
|
||||
it('File Libraries breadcrumb main node - [C260966]', async () => {
|
||||
await page.clickFileLibraries();
|
||||
it('My Libraries breadcrumb main node - [C260966]', async () => {
|
||||
await page.clickMyLibraries();
|
||||
expect(await breadcrumb.getItemsCount()).toEqual(1, 'Breadcrumb has incorrect number of items');
|
||||
expect(await breadcrumb.getCurrentItemName()).toBe('File Libraries');
|
||||
expect(await breadcrumb.getCurrentItemName()).toBe('My Libraries');
|
||||
});
|
||||
|
||||
it('Favorite Libraries breadcrumb main node - [C289891]', async () => {
|
||||
await page.clickFavoriteLibraries();
|
||||
expect(await breadcrumb.getItemsCount()).toEqual(1, 'Breadcrumb has incorrect number of items');
|
||||
expect(await breadcrumb.getCurrentItemName()).toBe('Favorite Libraries');
|
||||
});
|
||||
|
||||
it('Recent Files breadcrumb main node - [C260971]', async () => {
|
||||
|
Reference in New Issue
Block a user