Skip to content

Commit

Permalink
Add test for new ignore listen protocols setting
Browse files Browse the repository at this point in the history
  • Loading branch information
sidoh committed Nov 23, 2024
1 parent f37b20e commit 5493c2f
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions test/remote/spec/settings_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,21 @@
'mqtt_retain' => [true, false],
'packet_repeats_per_loop' => [10],
'home_assistant_discovery_prefix' => ['', 'abc', 'a/b/c'],
'default_transition_period' => [200, 500]
'default_transition_period' => [200, 500],
'ignored_listen_protocols' => [['RGBW'], ['FUT089', 'RGBW'], ['FUT089', 'RGB', 'RGBW']]
}.each do |key, values|
values.each do |v|
@client.patch_settings({key => v})
expect(@client.get('/settings')[key]).to eq(v), "Should persist #{key} possible value: #{v}"
updated_settings = @client.get('/settings')
updated_value = updated_settings[key]
expected_value = v

if updated_value.is_a?(Array)
updated_value = updated_value.sort
expected_value = expected_value.sort
end

expect(updated_value).to eq(expected_value), "Should persist #{key}. Tested value: #{v}, actual value: #{updated_value}"
end
end
end
Expand Down

0 comments on commit 5493c2f

Please sign in to comment.