Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
bramstroker committed Jul 27, 2022
1 parent 6a8d71b commit bb2d761
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/test_config_flow.py
Expand Up @@ -333,6 +333,18 @@ async def test_create_group_entry(hass: HomeAssistant):
await hass.async_block_till_done()
assert hass.states.get("sensor.my_group_sensor_power")

async def test_group_error_mandatory(hass: HomeAssistant):
result = await _select_sensor_type(hass, SensorType.GROUP)
user_input = {
CONF_NAME: "My group sensor",
CONF_UNIQUE_ID: DEFAULT_UNIQUE_ID
}
result = await hass.config_entries.flow.async_configure(
result["flow_id"], user_input
)
assert result["type"] == data_entry_flow.FlowResultType.FORM
assert result["errors"]
assert result["errors"]["base"] == "group_mandatory"

async def test_fixed_options_flow(hass: HomeAssistant):
entry = _create_mock_entry(
Expand Down

0 comments on commit bb2d761

Please sign in to comment.