-
Notifications
You must be signed in to change notification settings - Fork 313
narrow: Add starred messages narrow #870
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
a2dc3ef
115a5e5
fe5dc29
5bcb5d4
9daa940
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -122,27 +122,19 @@ void main() { | |
}); | ||
|
||
group('presents message content appropriately', () { | ||
// regression test for https://github.com/zulip/zulip-flutter/issues/736 | ||
testWidgets('content in "Combined feed" not asked to consume insets (including bottom)', (tester) async { | ||
testWidgets('content not asked to consume insets (including bottom), even without compose box', (tester) async { | ||
// Regression test for: https://github.com/zulip/zulip-flutter/issues/736 | ||
const fakePadding = FakeViewPadding(left: 10, top: 10, right: 10, bottom: 10); | ||
tester.view.viewInsets = fakePadding; | ||
tester.view.padding = fakePadding; | ||
|
||
await setupMessageListPage(tester, narrow: const CombinedFeedNarrow(), | ||
messages: [eg.streamMessage(content: ContentExample.codeBlockPlain.html)]); | ||
|
||
final element = tester.element(find.byType(CodeBlock)); | ||
final padding = MediaQuery.of(element).padding; | ||
check(padding).equals(EdgeInsets.zero); | ||
}); | ||
|
||
testWidgets('content in MentionsNarrow not asked to consume insets (including bottom)', (tester) async { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh one other commit-message comment:
The last sentence here doesn't sound right, as this test didn't check that the narrow doesn't have a compose box. Rather, if the narrow had a compose box, the test would pass even if the bug were to return on other narrows that don't have the compose box. The original bug reproduced only on CombinedFeedNarrow (the only narrow lacking a compose box at the time), which is why the repro test used that narrow. |
||
const fakePadding = FakeViewPadding(left: 10, top: 10, right: 10, bottom: 10); | ||
tester.view.viewInsets = fakePadding; | ||
tester.view.padding = fakePadding; | ||
|
||
await setupMessageListPage(tester, narrow: const MentionsNarrow(), | ||
messages: [eg.streamMessage(content: ContentExample.codeBlockPlain.html, flags: [MessageFlag.mentioned])]); | ||
// Verify this message list lacks a compose box. | ||
// (The original bug wouldn't reproduce with a compose box present.) | ||
final state = MessageListPage.ancestorOf(tester.element(find.text("verb\natim"))); | ||
check(state.composeBoxController).isNull(); | ||
|
||
final element = tester.element(find.byType(CodeBlock)); | ||
final padding = MediaQuery.of(element).padding; | ||
|
@@ -735,6 +727,15 @@ void main() { | |
check(findInMessageList('topic name')).length.equals(1); | ||
}); | ||
|
||
testWidgets('show channel name in StarredMessagesNarrow', (tester) async { | ||
await setupMessageListPage(tester, | ||
narrow: const StarredMessagesNarrow(), | ||
messages: [message], subscriptions: [eg.subscription(stream)]); | ||
await tester.pump(); | ||
check(findInMessageList('stream name')).length.equals(1); | ||
check(findInMessageList('topic name')).length.equals(1); | ||
}); | ||
|
||
testWidgets('do not show channel name in ChannelNarrow', (tester) async { | ||
await setupMessageListPage(tester, | ||
narrow: ChannelNarrow(stream.streamId), | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm indeed. But I'm a bit puzzled then: why wasn't this test already failing?
Ah it's because the code actually will show the message. So this is just a realism fix, making the simulated server response something a non-buggy server might give on this request.