app/frontend/comments/add_comment_form.component.test.jsx in decidim-comments-0.0.5 vs app/frontend/comments/add_comment_form.component.test.jsx in decidim-comments-0.0.6
- old
+ new
@@ -59,23 +59,23 @@
});
it("should use prop submitButtonClassName as a className prop for submit button", () => {
const wrapper = shallow(<AddCommentForm addComment={addCommentStub} session={session} commentable={commentable} submitButtonClassName="button small hollow" />);
- expect(wrapper.find('input[type="submit"]')).to.have.className('button');
- expect(wrapper.find('input[type="submit"]')).to.have.className('small');
- expect(wrapper.find('input[type="submit"]')).to.have.className('hollow');
+ expect(wrapper.find('button[type="submit"]')).to.have.className('button');
+ expect(wrapper.find('button[type="submit"]')).to.have.className('small');
+ expect(wrapper.find('button[type="submit"]')).to.have.className('hollow');
});
it("should enable the submit button if textarea is not blank", () => {
const wrapper = mount(<AddCommentForm addComment={addCommentStub} session={session} commentable={commentable} />);
wrapper.find('textarea').simulate('change', {
target: {
value: 'This is a comment'
}
});
- expect(wrapper.find('input[type="submit"]')).not.to.be.disabled();
+ expect(wrapper.find('button[type="submit"]')).not.to.be.disabled();
});
it("should disable the submit button if textarea is blank", () => {
const wrapper = mount(<AddCommentForm addComment={addCommentStub} session={session} commentable={commentable} />);
wrapper.find('textarea').simulate('change', {
@@ -86,10 +86,10 @@
wrapper.find('textarea').simulate('change', {
target: {
value: ''
}
});
- expect(wrapper.find('input[type="submit"]')).to.be.disabled();
+ expect(wrapper.find('button[type="submit"]')).to.be.disabled();
});
it("should not render a div with class 'opinion-toggle'", () => {
const wrapper = shallow(<AddCommentForm addComment={addCommentStub} session={session} commentable={commentable} />);
expect(wrapper.find('.opinion-toggle')).not.to.be.present();