"""Unit tests for DeveloperToolsWidget."""

from PySide6.QtWebEngineWidgets import QWebEngineView

from webdrop_bridge.ui.developer_tools import DeveloperToolsWidget


def test_developer_tools_widget_attaches_inspected_page(qtbot):
    """DeveloperToolsWidget should inspect the provided web view page directly."""
    web_view = QWebEngineView()
    qtbot.addWidget(web_view)

    dev_tools = DeveloperToolsWidget(web_view)
    qtbot.addWidget(dev_tools)

    assert dev_tools.dev_tools_view.page().inspectedPage() is web_view.page()
