Skip to content
This repository has been archived by the owner on May 19, 2020. It is now read-only.

Commit

Permalink
Add the selector detection
Browse files Browse the repository at this point in the history
  • Loading branch information
rememberlenny committed Aug 1, 2017
1 parent a7813cf commit 80ca7d6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions static_src/components/users_org_user_selector.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,13 @@ export default class OrgUsersSelector extends React.Component {
}

return (
<div className="test-users-invite">
<div className="test-users-selector">
<PanelDocumentation description>
<p>{ this.invitationMessage }</p>
</PanelDocumentation>
<Form
guid={ USERS_PARENT_ENTITY_USER_FORM_GUID }
classes={ ['users_parent_entity_user_form'] }
classes={ ['org_user_selector'] }
ref="form"
onSubmit={ this._onSubmitForm }
>
Expand Down
6 changes: 6 additions & 0 deletions static_src/test/functional/pageobjects/user_invite.element.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ export default class UserInviteElement extends BaseElement {
return browser.elements('.test-users .complex_list-item').value.length;
}

// TODO move this to user list element.
countNumberOfUserSelectors() {
browser.waitForExist('.test-users-selector');
return browser.elements('.test-users-selector').value.length;
}

// TODO move this to user list element.
getUserByIndex(idx) {
const sel = `.test-users .complex_list-item:nth-child(${idx})`;
Expand Down
8 changes: 3 additions & 5 deletions static_src/test/functional/user_invite.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,13 @@ describe('User roles', function () {
browser.waitForExist('.test-users');
});

it('should not have the user invite panel', function () {
it('should have the user selector panel', function () {
userRoleElement.setAndGetUserRole(cookieManagerOrgXSpaceXX);
browser.url(urlOrgXSpaceXX);

browser.waitForExist('.test-users');
browser.waitForExist('.test-users-invite', 500, true);
const ells = browser.elements('.test-users-invite');
const userSelectorCount = userInviteElement.countNumberOfUserSelectors();

expect(ells.length).toBe(undefined);
expect(userSelectorCount).toBe(1);
});
});
});

0 comments on commit 80ca7d6

Please sign in to comment.