Hacker News new | ask | show | jobs
by moltar 1404 days ago
You could apply extra data props as hooks that describe certain states. This is the approach taken by Cypress.

E.g.

<div data-state=“success”>

Then check for existence of the prop rather than CSS classes.