zulip / zulip

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
https://zulip.com
Apache License 2.0
21.62k stars 7.86k forks source link

web stream_color: Test `get_stream_privacy_icon_color`/`get_recipient_bar_color` against a table #27471

Open chrisbobbe opened 1 year ago

chrisbobbe commented 1 year ago

From discussion: https://chat.zulip.org/#narrow/stream/101-design/topic/UI.20redesign.3A.20recipient.20bar.20colors/near/1673209

We should add regression tests for these functions in web/src/stream_color.js:

To do that, let's first make a list of "base" stream colors to test as inputs, including:

Then call the functions on each of those and make a table, like:

Base stream color get_recipient_bar_color get_stream_privacy_icon_color
#94c849 #e4eed3 #94c849
#fae589 #f0ead6 #cbb85e
(etc., many more)

We'll hard-code that table in a test file. For the actual tests, we'll go through the table row by row and check that get_stream_privacy_icon_color and get_recipient_bar_color give values that match the table.

The tests should cover both light and dark mode.

zulipbot commented 1 year ago

Hello @zulip/design members, this issue was labeled with the "design", "redesign" labels, so you may want to check it out!

chrisbobbe commented 1 year ago

If the implementation doesn't match the intended design (which is an open question), we should fix the implementation too.