I wanna validate a field that doesent allow inputs of values (it is blocked with a determinete status). I have search many asserts, but I did not have luck with find that specific demand.
Here is my field before block:
<select class="form-control form-controle valid" data-val="true" data-val-number="O campo IdCategoria deve ser um número." data-val-required="The IdCategoria field is required." id="IdCategoria" name="IdCategoria" aria-describedby="IdCategoria-error" aria-invalid="false"><option selected="selected" value="0">Selecione uma categoria</option> </select>
Here is my field after block:
<select class="form-control form-controle valid formBloqueaEdicao" data-val="true" data-val-number="O campo IdCategoria deve ser um número." data-val-required="The IdCategoria field is required." id="IdCategoria" name="IdCategoria" readonly="readonly" style="pointer-events: none;"><option selected="selected" value="0">Selecione uma categoria</option> </select>
I have implemented the following code, but I am not sure that is the best and safe solution:
cy.get('#IdCategoria').should('have.class', 'form-control form-controle valid formBloqueaEdicao')
Any others solutions?