Skip to content

Commit

Permalink
[fixed] Render testId property
Browse files Browse the repository at this point in the history
  • Loading branch information
adammahmood authored and diasbruno committed Oct 27, 2018
1 parent 1b561fc commit 6a6bcf7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions specs/Modal.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,14 @@ export default () => {
unmountModal();
});

it("additional testId attribute", () => {
const modal = renderModal({ isOpen: true, testId: "foo-bar" }, "hello");
mcontent(modal)
.getAttribute("data-testid")
.should.be.eql("foo-bar");
unmountModal();
});

it("raises an exception if the appElement selector does not match", () => {
should(() => ariaAppHider.setElement(".test")).throw();
});
Expand Down
1 change: 1 addition & 0 deletions src/components/ModalPortal.js
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ export default class ModalPortal extends Component {
aria-label={this.props.contentLabel}
{...this.attributesFromObject("aria", this.props.aria || {})}
{...this.attributesFromObject("data", this.props.data || {})}
data-testid={this.props.testId}
>
{this.props.children}
</div>
Expand Down

0 comments on commit 6a6bcf7

Please sign in to comment.