Skip to content

Commit

Permalink
Fix store permissions for non-cf admin
Browse files Browse the repository at this point in the history
- also improve sub tab button click
  • Loading branch information
richard-cox committed Sep 27, 2019
1 parent 159f8f1 commit 1a0f7dc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
withLatestFrom,
} from 'rxjs/operators';

import { entityCatalogue } from '../../../../core/src/core/entity-catalogue/entity-catalogue.service';
import { LoggerService } from '../../../../core/src/core/logger.service';
import { CONNECT_ENDPOINTS_SUCCESS, EndpointActionComplete } from '../../../../store/src/actions/endpoint.actions';
import {
Expand Down Expand Up @@ -111,8 +112,10 @@ function fetchCfUserRole(store: Store<CFAppState>, action: GetUserRelations, htt
);
}

const fetchPaginationStateFromAction = (store: Store<CFAppState>, action: BasePaginatedAction) =>
store.select(selectPaginationState(action.entityType, action.paginationKey));
const fetchPaginationStateFromAction = (store: Store<CFAppState>, action: BasePaginatedAction) => {
const entityKey = entityCatalogue.getEntityKey(action);
return store.select(selectPaginationState(entityKey, action.paginationKey));
};

/**
* Using the given action wait until the associated pagination section changes from busy to not busy
Expand Down
8 changes: 7 additions & 1 deletion src/test-e2e/po/page-header-sub.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,14 @@ export class PageHeaderSubPo extends Component {
});
}

waitForIconButton(iconName: string): promise.Promise<void> {
return browser.wait(
this.until.presenceOf(this.locator.element(by.cssContainingText('.page-header-sub-nav__container button mat-icon', iconName)))
);
}

clickIconButton(iconName: string): promise.Promise<void> {
return this.getIconButton(iconName).then(btn => btn.click());
return this.waitForIconButton(iconName).then(() => this.getIconButton(iconName).then(btn => btn.click()));
}

hasIconButton(iconName: string): promise.Promise<boolean> {
Expand Down

0 comments on commit 1a0f7dc

Please sign in to comment.