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

Restore entity specific button text #1169

Merged
merged 2 commits into from
Jul 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion static_src/components/users_invite.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export default class UsersInvite extends React.Component {
type="submit"
disabled={ inviteDisabled }
>
Add user to this { this.state.inviteEntityType }
Add user to this { this.props.inviteEntityType }
</Action>
</Form>
</div>
Expand Down
12 changes: 12 additions & 0 deletions static_src/test/unit/components/users_invite.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,18 @@ describe('<UsersInvite />', function () {

expect(wrapper.find(PanelDocumentation).find('p').text()).toBe(doc);
});

it('refers to `organization` when type is organization in the action button', () => {
const buttonHTML = '<button class="action action-primary usa-button ' +
'usa-button-primary" aria-label="submit" type="submit">' +
'Add user to this organization</button>';
const orgProps = Object.assign({}, props, {
inviteEntityType: 'organization'
});
wrapper = shallow(<UsersInvite { ...orgProps } />);

expect(wrapper.find(Action).html()).toEqual(buttonHTML);
});
});
});

Expand Down