Skip to content

Commit

Permalink
Improve project overview item selectors in overview integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
TheRealJon committed Jan 16, 2019
1 parent 3b45be6 commit f5511a6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
10 changes: 3 additions & 7 deletions frontend/integration-tests/views/overview.view.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { $, $$, browser, by, ExpectedConditions as until } from 'protractor';
import { $, $$, browser, by, element, ExpectedConditions as until } from 'protractor';

export const projectOverview = $('.project-overview');
const projectOverviewItemSelector = '.project-overview__item';
Expand All @@ -13,15 +13,11 @@ export const itemsAreVisible = () => {
};

export const getProjectOverviewListItemsOfKind = (kindModel) => {
return projectOverviewListItems.filter(async(e) => {
return await e.element(by.className(`co-m-resource-${kindModel.id}`)).isPresent();
});
return $$(`.project-overview__item--${kindModel.kind}`);
};

export const getProjectOverviewListItem = (kindModel, name) => {
return getProjectOverviewListItemsOfKind(kindModel).filter(async(e) => {
return await e.element(by.linkText(name)).isPresent();
});
return element(by.cssContainingText(`.project-overview__item--${kindModel.kind}`, name));
};

export const sidebarIsLoaded = () => {
Expand Down
2 changes: 1 addition & 1 deletion frontend/public/components/overview/project-overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ const ProjectOverviewListItem = connect<ProjectOverviewListItemPropsFromState, P
// Hide metrics when a selection is active.
const hasSelection = !!selectedUID;
const isSelected = uid === selectedUID;
const className = classnames('project-overview__item', {'project-overview__item--selected': isSelected});
const className = classnames(`project-overview__item project-overview__item--${kind}`, {'project-overview__item--selected': isSelected});
const heading = <h3 className="project-overview__item-heading">
<span className="co-resource-link co-resource-link-truncate">
<ResourceIcon kind={kind} />
Expand Down

0 comments on commit f5511a6

Please sign in to comment.