async def test_computed_vars(
    computed_vars: AppHarness,
    driver: WebDriver,
    token: str,
):
    """Test that computed vars are working as expected.

    Args:
        computed_vars: harness for ComputedVars app.
        driver: WebDriver instance.
        token: The token for the connected client.
    """
    assert computed_vars.app_instance is not None

    state_name = computed_vars.get_state_name("_state")
    full_state_name = computed_vars.get_full_state_name(["_state"])
    token = f"{token}_{full_state_name}"
    state = (await computed_vars.get_state(token)).substates[state_name]
    assert state is not None
    assert state.count1_backend == 0
    assert state._count1_backend == 0

    # test that backend var is not rendered
    count1_backend = driver.find_element(By.ID, "count1_backend")
    assert count1_backend
    assert count1_backend.text == ""
    _count1_backend = driver.find_element(By.ID, "_count1_backend")
    assert _count1_backend
    assert _count1_backend.text == ""

    count = driver.find_element(By.ID, "count")
    assert count
    assert count.text == "0"

    count1 = driver.find_element(By.ID, "count1")
    assert count1
    assert count1.text == "0"

    count3 = driver.find_element(By.ID, "count3")
    assert count3
    assert count3.text == "0"

    depends_on_count = driver.find_element(By.ID, "depends_on_count")
    assert depends_on_count
    assert depends_on_count.text == "0"

    depends_on_count1 = driver.find_element(By.ID, "depends_on_count1")
    assert depends_on_count1
    assert depends_on_count1.text == "0"

    depends_on_count3 = driver.find_element(By.ID, "depends_on_count3")
    assert depends_on_count3
    assert depends_on_count3.text == "0"

    special_floats = driver.find_element(By.ID, "special_floats")
    assert special_floats
    assert special_floats.text == "42.9, NaN, Infinity, -Infinity"

    increment = driver.find_element(By.ID, "increment")
    assert increment.is_enabled()

    mark_dirty = driver.find_element(By.ID, "mark_dirty")
    assert mark_dirty.is_enabled()

    mark_dirty.click()

    increment.click()
    assert computed_vars.poll_for_content(count, timeout=2, exp_not_equal="0") == "1"
    assert computed_vars.poll_for_content(count1, timeout=2, exp_not_equal="0") == "1"
    assert (
        computed_vars.poll_for_content(depends_on_count, timeout=2, exp_not_equal="0")
        == "1"
    )
    state = (await computed_vars.get_state(token)).substates[state_name]
    assert state is not None
    assert state.count1_backend == 1
    assert count1_backend.text == ""
    assert state._count1_backend == 1
    assert _count1_backend.text == ""

    mark_dirty.click()
    with pytest.raises(TimeoutError):
        _ = computed_vars.poll_for_content(count3, timeout=5, exp_not_equal="0")

    await asyncio.sleep(10)
    assert count3.text == "0"
    assert depends_on_count3.text == "0"
    mark_dirty.click()
    assert computed_vars.poll_for_content(count3, timeout=2, exp_not_equal="0") == "1"
    assert depends_on_count3.text == "1"
Test that computed vars are working as expected.

    Args:
        computed_vars: harness for ComputedVars app.
        driver: WebDriver instance.
        token: The token for the connected client.
    
tests/integration/test_computed_vars.py