ui: contrast_mode: test: make calculating the contrast with javascript work

part of [#61132882]
ui: contrast_mode: finish integration tests for all scenarios

part of [#61132882]