Add a new monkeypatch to ensure isVisible is called correctly