[ACA-2320] Navigation - support store actions (#1052)

* move component into folder

* update module

* add children template references

* clean up styling

* clean up theme

* use content projection

* remove old tests

* button menu component

* expand menu component

* link item component

* resolve action directive

* custom active link directive

* collapse template reference

* expanded template reference

* expansion panel directive

* item template directive

* menu panel directive

* support for ngrx actions

* update side navigation inplementation

* remove unused component

* remove unused styling

* update module

* clean up

* unit tests

* unit tests

* remove unused component

* lint

* remove unused import

* fix test

* add tooltip

* fix text

* fix e2e

* use action route commands

* remove fdescribe

* styles fix

* e2e fix tooltip test

* fix active route when drill down

* update docs
This commit is contained in:
Cilibiu Bogdan
2019-04-05 13:03:40 +01:00
committed by Denys Vuika
parent 9f127c0530
commit 839c9d0dbb
30 changed files with 1493 additions and 451 deletions
+6 -5
View File
@@ -32,13 +32,14 @@ import { Utils } from '../../utilities/utils';
export class Sidenav extends Component {
private static selectors = {
root: 'app-sidenav',
link: '.menu__item',
label: '.item--label',
link: '.item',
label: '.action-button__label',
expansion_panel: ".mat-expansion-panel-header",
expansion_panel_content: ".mat-expansion-panel-body",
active: 'mat-accent',
activeClass: '.item--active',
activeChild: 'item--active',
activeClass: '.action-button--active',
activeClassName: 'action-button--active',
activeChild: 'action-button--active',
newButton: '[data-automation-id="create-button"]',
@@ -106,7 +107,7 @@ export class Sidenav extends Component {
}
async isActive(name: string) {
return await this.getLinkLabel(name).isElementPresent(by.css(Sidenav.selectors.activeClass));
return (await this.getLinkLabel(name).getAttribute('class')).includes(Sidenav.selectors.activeClassName);
}
async childIsActive(name: string) {
+6 -6
View File
@@ -61,22 +61,22 @@ describe('Sidebar', () => {
it('My Libraries is automatically selected on expanding File Libraries - [C289900]', async () => {
await sidenav.expandFileLibraries();
expect(await browser.getCurrentUrl()).toContain(APP_ROUTES.MY_LIBRARIES);
expect(await sidenav.isActive(SIDEBAR_LABELS.FILE_LIBRARIES)).toBe(false, 'File Libraries link is active');
expect(await sidenav.childIsActive(SIDEBAR_LABELS.MY_LIBRARIES)).toBe(true, 'My Libraries link not active');
expect(await sidenav.isActive(SIDEBAR_LABELS.FILE_LIBRARIES)).toBe(true, 'File Libraries is not active');
expect(await sidenav.isActive(SIDEBAR_LABELS.MY_LIBRARIES)).toBe(true, 'My Libraries link not active');
});
it('navigate to Favorite Libraries - [C289902]', async () => {
await page.goToFavoriteLibraries();
expect(await browser.getCurrentUrl()).toContain(APP_ROUTES.FAVORITE_LIBRARIES);
expect(await sidenav.isActive(SIDEBAR_LABELS.FILE_LIBRARIES)).toBe(false, 'File Libraries link is active');
expect(await sidenav.childIsActive(SIDEBAR_LABELS.FAVORITE_LIBRARIES)).toBe(true, 'Favorite Libraries link not active');
expect(await sidenav.isActive(SIDEBAR_LABELS.FILE_LIBRARIES)).toBe(true, 'File Libraries link is not active');
expect(await sidenav.isActive(SIDEBAR_LABELS.FAVORITE_LIBRARIES)).toBe(true, 'Favorite Libraries link not active');
});
it('navigate to My Libraries - [C289901]', async () => {
await page.goToMyLibraries();
expect(await browser.getCurrentUrl()).toContain(APP_ROUTES.MY_LIBRARIES);
expect(await sidenav.isActive(SIDEBAR_LABELS.FILE_LIBRARIES)).toBe(false, 'File Libraries link is active');
expect(await sidenav.childIsActive(SIDEBAR_LABELS.MY_LIBRARIES)).toBe(true, 'My Libraries link not active');
expect(await sidenav.isActive(SIDEBAR_LABELS.FILE_LIBRARIES)).toBe(true, 'File Libraries link is not active');
expect(await sidenav.isActive(SIDEBAR_LABELS.MY_LIBRARIES)).toBe(true, 'My Libraries link not active');
});
it('navigates to "Shared Files" - [C213110]', async () => {