Skip to content

Conversation

@chrisbobbe
Copy link
Collaborator

@chrisbobbe chrisbobbe commented Nov 14, 2025

The main work here is to change several tests of MessageListView and MessageStore so that the channels they exercise are actually known (i.e. present in the store) and subscribed, which we can consider the boring, common case. Without this change, some of these tests would fail when we change the behavior for unsubscribed channels, for #1798.

Compare d6f2441 and f89ce2e, where we similarly changed the setup for various widget tests, also to prepare for #1798.

Related: #1798

In all of these tests, the message list's narrow is a ChannelNarrow,
and all of the deleted messages are in that channel. The tests
aren't about whether or not the deleted messages are in the message
list's narrow; really they're about whether or not the deleted
messages are present in the MessageListView model.
Before this, in all the tests touched here, we were exercising the
message list with a channel that isn't actually in the
PerAccountStore. When we don't pass `stream` to the `prepare`
function, the function adds a *different* channel to the store, with
a corresponding Subscription, having streamId
eg.defaultStreamMessageStreamId.

The normal, boring setup, which is suitable for all these tests, is
to exercise the message list in a known, subscribed channel. Provide
that setup by passing the same `stream` object to `prepare` that we
use to create messages and narrows.
…boring

The `prepare` helper, and now the prepare-outbox helpers, fall back
to this channel ID when a different one isn't specified. That's
sensible and lets these tests be a bit more compact.

When tests use two different channels, with pairs of variables like
`stream` and `otherStream`, or `stream1` and `stream2`, I let that
be, even though it might be reasonable for some of them to use
eg.defaultStreamMessageStreamId for one of the channels.
This is the boring, common case that makes sense to exercise here.
@chrisbobbe chrisbobbe added the maintainer review PR ready for review by Zulip maintainers label Nov 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer review PR ready for review by Zulip maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants