Add test of remote enabling of remote UI (#109698)

pull/109699/head
Erik Montnemery 2024-02-05 13:07:57 +01:00 committed by GitHub
parent 70ceddf165
commit 30710815f0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 0 deletions

View File

@ -472,3 +472,14 @@ async def test_logged_out(
assert cloud.client._alexa_config is alexa_config_mock
assert cloud.client._google_config is None
google_config_mock.async_deinitialize.assert_called_once_with()
async def test_remote_enable(hass: HomeAssistant) -> None:
"""Test enabling remote UI."""
prefs = MagicMock(async_update=AsyncMock(return_value=None))
client = CloudClient(hass, prefs, None, {}, {})
client.cloud = MagicMock(is_logged_in=True, username="mock-username")
result = await client.async_cloud_connect_update(True)
assert result is None
prefs.async_update.assert_called_once_with(remote_enabled=True)