Is there a chance to conditionally run a chained method ?
I want to simplify this expression to be a one-liner but can't find a solution for the blocking .not. on the expect.
const checkSomething = (element, value = true) => {
if (value) {
expect(element).toBeVisible()
} else {
expect(element).not.toBeVisible()
}
}