Ensure cast tests add config entry before updating it (#110416)

This commit is contained in:
J. Nick Koston 2024-02-12 16:06:13 -06:00 committed by GitHub
parent 067645520a
commit 92842c28d2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3,7 +3,7 @@ from unittest.mock import patch
import pytest
from homeassistant.components.cast import home_assistant_cast
from homeassistant.components.cast import DOMAIN, home_assistant_cast
from homeassistant.config import async_process_ha_core_config
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import HomeAssistantError
@ -56,7 +56,9 @@ async def test_service_show_view_dashboard(
hass,
{"external_url": "https://example.com"},
)
await home_assistant_cast.async_setup_ha_cast(hass, MockConfigEntry())
entry = MockConfigEntry(domain=DOMAIN)
entry.add_to_hass(hass)
await home_assistant_cast.async_setup_ha_cast(hass, entry)
calls = async_mock_signal(hass, home_assistant_cast.SIGNAL_HASS_CAST_SHOW_VIEW)
await hass.services.async_call(