Skip to content

Commit

Permalink
msglist tests: Add snapshot with unsubscribed-stream header
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbobbe committed Mar 15, 2022
1 parent 137c020 commit 51b582f
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1526,6 +1526,38 @@ exports[`messages -> piece descriptors -> content HTML is stable/sensible all-pm
</div>"
`;

exports[`messages -> piece descriptors -> content HTML is stable/sensible other interesting cases (single messages) message in unsubscribed stream 1`] = `
"<div class=\\"msglist-element timerow\\" data-msg-id=\\"-1\\">
<div class=\\"timerow-left\\"></div>
Dec 31, 1969
<div class=\\"timerow-right\\"></div>
</div><div class=\\"msglist-element header-wrapper header stream-header topic-header\\" data-msg-id=\\"-1\\" data-narrow=\\"dG9waWM6MTpleGFtcGxlIHRvcGlj\\">
<div class=\\"header stream-text\\" style=\\"color: black;
background: hsl(0, 0%, 80%)\\" data-narrow=\\"c3RyZWFtOjE=\\">
# stream 1
</div>
<div class=\\"topic-text\\">example topic</div>
<div class=\\"topic-date\\">Dec 31, 1969</div>
</div><div class=\\"msglist-element message message-full\\" id=\\"msg--1\\" data-msg-id=\\"-1\\" data-mute-state=\\"shown\\">
<div class=\\"avatar\\">
<img src=\\"https://zulip.example.org/yo/avatar-nonrandom%20name%20sender.png\\" alt=\\"Nonrandom name sender User\\" class=\\"avatar-img\\" data-sender-id=\\"10\\">
</div>
<div class=\\"content\\">
<div class=\\"subheader\\">
<div class=\\"name-and-status-emoji\\" data-sender-id=\\"10\\">
Nonrandom name sender User
</div>
<div class=\\"static-timestamp\\">11:59 PM</div>
</div>
<p>This is an example stream message.</p>



</div>

</div>"
`;

exports[`messages -> piece descriptors -> content HTML is stable/sensible other interesting cases (single messages) message with a poll 1`] = `
"<div class=\\"msglist-element timerow\\" data-msg-id=\\"-1\\">
<div class=\\"timerow-left\\"></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1526,6 +1526,38 @@ exports[`messages -> piece descriptors -> content HTML is stable/sensible all-pm
</div>"
`;

exports[`messages -> piece descriptors -> content HTML is stable/sensible other interesting cases (single messages) message in unsubscribed stream 1`] = `
"<div class=\\"msglist-element timerow\\" data-msg-id=\\"-1\\">
<div class=\\"timerow-left\\"></div>
Dec 31, 1969
<div class=\\"timerow-right\\"></div>
</div><div class=\\"msglist-element header-wrapper header stream-header topic-header\\" data-msg-id=\\"-1\\" data-narrow=\\"dG9waWM6MTpleGFtcGxlIHRvcGlj\\">
<div class=\\"header stream-text\\" style=\\"color: black;
background: hsl(0, 0%, 80%)\\" data-narrow=\\"c3RyZWFtOjE=\\">
# stream 1
</div>
<div class=\\"topic-text\\">example topic</div>
<div class=\\"topic-date\\">Dec 31, 1969</div>
</div><div class=\\"msglist-element message message-full\\" id=\\"msg--1\\" data-msg-id=\\"-1\\" data-mute-state=\\"shown\\">
<div class=\\"avatar\\">
<img src=\\"https://zulip.example.org/yo/avatar-nonrandom%20name%20sender.png\\" alt=\\"Nonrandom name sender User\\" class=\\"avatar-img\\" data-sender-id=\\"10\\">
</div>
<div class=\\"content\\">
<div class=\\"subheader\\">
<div class=\\"name-and-status-emoji\\" data-sender-id=\\"10\\">
Nonrandom name sender User
</div>
<div class=\\"static-timestamp\\">11:59 PM</div>
</div>
<p>This is an example stream message.</p>



</div>

</div>"
`;

exports[`messages -> piece descriptors -> content HTML is stable/sensible other interesting cases (single messages) message with a poll 1`] = `
"<div class=\\"msglist-element timerow\\" data-msg-id=\\"-1\\">
<div class=\\"timerow-left\\"></div>
Expand Down
15 changes: 15 additions & 0 deletions src/webview/__tests__/generateInboundEventEditSequence-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,21 @@ describe('messages -> piece descriptors -> content HTML is stable/sensible', ()
sender: singleMessageSender,
});

test('message in unsubscribed stream', () => {
check({
narrow: HOME_NARROW,
messages: [baseSingleMessage],
state: eg.reduxStatePlus({
streams: [...eg.plusReduxState.streams, stream1, stream2],
subscriptions: [
...eg.plusReduxState.subscriptions,
// no subscription for stream1
eg.makeSubscription({ stream: stream2 }),
],
}),
});
});

test('message with reactions', () => {
check({
narrow: HOME_NARROW,
Expand Down

0 comments on commit 51b582f

Please sign in to comment.