Switch imap to use async_update_reload_and_abort helper (#108935)

This commit is contained in:
J. Nick Koston 2024-01-26 17:55:26 -10:00 committed by GitHub
parent b1b53ac893
commit 5177d022e8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 3 deletions

View File

@ -169,11 +169,9 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
if user_input is not None:
user_input = {**self._reauth_entry.data, **user_input}
if not (errors := await validate_input(self.hass, user_input)):
self.hass.config_entries.async_update_entry(
return self.async_update_reload_and_abort(
self._reauth_entry, data=user_input
)
await self.hass.config_entries.async_reload(self._reauth_entry.entry_id)
return self.async_abort(reason="reauth_successful")
return self.async_show_form(
description_placeholders={

View File

@ -239,6 +239,7 @@ async def test_reauth_success(hass: HomeAssistant, mock_setup_entry: AsyncMock)
CONF_PASSWORD: "test-password",
},
)
await hass.async_block_till_done()
assert result2["type"] == FlowResultType.ABORT
assert result2["reason"] == "reauth_successful"