mardi 26 juin 2018

Disabled is not considered an HTML attribute

I have this button in html

<button id="ref_button" type="submit" [disabled]="editForm.form.invalid || isSaving" class="btn btn-primary">
           

I am testing it like this using Chai:

 dom.window.document.getElementById("ref_button").should.have.attr('type');

And it works perfectly. But if I want to test the same way the disabled attribute the test doesn't work:

  dom.window.document.getElementById("ref_button").should.have.attr('disabled');

Maybe it is not an attribute??? How can I test it?

Aucun commentaire:

Enregistrer un commentaire