So I have an element that has a class that has display: none; but when I do expect(screen.getByTestId('header')).not.toBeVisible(); it tells me it's visible. I want to test that the user cannot see anything in this element.
<div className={classNames}>
<header className={styles.header} data-testid="header">
<div>
<span className={styles.eventTime}>{timeText}</span>
</div>
<div className={styles.topright}></div>
</header>
</div>
So based on some criteria that classNames variable can add a class that is will set the header class to have display none.