# How to test using dom document variable?

I have this button in HTML in an angular project:

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


Now I have integrated everything like cucmber and protactor and am using chai-dom to test it. Since for chai-dom is needed jsdom to use the global variabled document I use this line to take the reference of the HTML document in my test files.

JSDOM.fromFile("src/main/webapp/app/entities/protocolo/protocolo-dialog.component.html", { runScripts: "dangerously" }).then(dom => {
//dom.window.document.getElementById('ref_id').hasAttribute('hidden').should.be.true;
dom.window.document.getElementById("ref_button").hasAttribute('disabled').should.be.true;
});


The problem is that it doesn’t recognise the disabled attribute. Is this because jsdom doesn’t execute scripts?
I’m left with no other solution here and the tests don’t work. Are there any suggestion or another library that can be better used?

Thanks.

Source: AngularJS