running cy.get().should('be.disabled') on an will return false, even when attr exists.
should return true, when disabled. This works for tag.
<a data-cy="test" disabled />
cy.get([data-cy=test]).should('be.disabled') => will fail
I think be.disabled relates to chaiJS
see: https://docs.cypress.io/guides/references/assertions.html#Chai-jQuery
And the official chaiJS docu refers to jquerys :disabled selector which does not check for the existence of the disabled attribute:

As you can see, the a tag is not supported by this assertion.
it goes deper actually
https://stackoverflow.com/questions/13955667/disabled-href-tag/13955695
Not cypress's fault at all. <a /> tag itself has no support for disabled, but it will still be represented in the DOM as an html attribute. A Cypress/Jquery assertion would be nice though, since additional logic can be built around it.
Im having the same issue with a div element
<div class="ag-filter-select" disabled="">
so Im using something like:
cy.get('.ag-filter-select').should('be.disabled');
Does anyone found a workaround?
I found this way cy.get('.ag-filter-select').should('have.attr', 'disabled', 'disabled') and it works.
I also had the same issue. cy.get().should('be.disabled') returned false when attr is disabled.
but it works in this way:
cy.get().should('have.attr', 'disabled');
cy.get().should('not.have.attr', 'disabled');
Most helpful comment
I found this way
cy.get('.ag-filter-select').should('have.attr', 'disabled', 'disabled')and it works.