async def test_on_drop(
    tmp_path,
    upload_file: AppHarness,
    driver: WebDriver,
):
    """Test the on_drop event handler.

    Args:
        tmp_path: pytest tmp_path fixture
        upload_file: harness for UploadFile app.
        driver: WebDriver instance.
    """
    assert upload_file.app_instance is not None
    token = poll_for_token(driver, upload_file)
    full_state_name = upload_file.get_full_state_name(["_upload_state"])
    state_name = upload_file.get_state_name("_upload_state")
    substate_token = f"{token}_{full_state_name}"

    upload_box = driver.find_elements(By.XPATH, "//input[@type='file']")[
        3
    ]  # quaternary upload
    assert upload_box

    exp_name = "drop_test.txt"
    exp_contents = "dropped file contents!"
    target_file = tmp_path / exp_name
    target_file.write_text(exp_contents)

    # Simulate file drop by directly setting the file input
    upload_box.send_keys(str(target_file))

    # Wait for the on_drop event to be processed
    await asyncio.sleep(0.5)

    async def exp_name_in_quaternary():
        state = await upload_file.get_state(substate_token)
        return exp_name in state.substates[state_name].quaternary_names

    # Poll until the file names appear in the display
    await AppHarness._poll_for_async(exp_name_in_quaternary)

    # Verify through state that the file names were captured correctly
    state = await upload_file.get_state(substate_token)
    assert exp_name in state.substates[state_name].quaternary_names
Test the on_drop event handler.

    Args:
        tmp_path: pytest tmp_path fixture
        upload_file: harness for UploadFile app.
        driver: WebDriver instance.
    
tests/integration/test_upload.py