zulip/static
Abhijeet Prasad Bodas 206fe1ef3b node tests: Introduce message_store.create_mock_message() helper.
Previously, it was tedious to create actual message
objects in message_store for use in node tests.
This was mainly because, `add_message_metadata`
in message_store has many dependencies and
validation checks. Since it was difficult to create
actual message objects, many tests just mocked
the `message_store.get()` method to return the desired
message.

This commit adds a new helper method (`create_mock_message`)
to message_store, for use in node tests. This just stores
the object passed to it in the `stores_messages` map,
without any validation. We do not add any
default fields to the message object before saving
it from this helper, because doing so would decrease
the utility of this helper, and, if a test
depends on some field having a particular value,
then it would be better to just pass the field: value
pair from the test itself, for readability, rather
than relying on the helper to add the field for us.

This helper allows us to write deeper tests.

This commit also replaces some instances of mocking
`message_store.get()` to use this new helper method.
2021-03-18 15:55:39 -07:00
..
assets docs: Fix more capitalization issues. 2020-10-23 11:46:55 -07:00
audio notificaiton_sounds: Add some atonal sounds created by @stwime. 2021-02-05 12:28:20 -08:00
generated
html logo: Update Zulip logo. 2020-07-16 01:37:08 -07:00
images logos: Optimize jotform.svg with svgo 2. 2021-03-04 12:24:25 -08:00
js node tests: Introduce message_store.create_mock_message() helper. 2021-03-18 15:55:39 -07:00
shared typeahead: Always rank exact string match first. 2021-02-25 17:55:54 -08:00
styles left-sidebar: Remove add-streams option out of scrollbar. 2021-03-16 14:10:04 -07:00
templates left sidebar: Don't show unstar-all button when redundant. 2021-03-18 15:52:06 -07:00
third refactor: Rename filter to linkifier in frontend code and docs. 2021-03-15 11:19:59 -07:00
.gitignore dependencies: Replace moment.js with date-fns. 2021-02-05 11:04:32 -08:00