Skip to content

Commit d7bcaab

Browse files
gnpricechrisbobbe
authored andcommitted
test [nfc]: Leave a few topics as explicit strings
These are being passed to test helpers which we'll leave as consuming String instead of TopicName, for convenience in other test cases. At these call sites the values were coming from fields that are or will become TopicName, though; so when that happens and we make TopicName no longer implicitly convertible to String, these will need to be explicitly String instead.
1 parent 827fccc commit d7bcaab

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

test/widgets/compose_box_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ void main() {
274274
final narrow = ChannelNarrow(channel.streamId);
275275
final destinationNarrow = eg.topicNarrow(narrow.streamId, 'test topic');
276276
await prepareComposeBox(tester, narrow: narrow, streams: [channel]);
277-
await enterTopic(tester, narrow: narrow, topic: destinationNarrow.topic);
277+
await enterTopic(tester, narrow: narrow, topic: 'test topic');
278278

279279
await checkStartTyping(tester, destinationNarrow);
280280

@@ -341,7 +341,7 @@ void main() {
341341
final narrow = ChannelNarrow(channel.streamId);
342342
final destinationNarrow = eg.topicNarrow(narrow.streamId, 'test topic');
343343
await prepareComposeBox(tester, narrow: narrow, streams: [channel]);
344-
await enterTopic(tester, narrow: narrow, topic: destinationNarrow.topic);
344+
await enterTopic(tester, narrow: narrow, topic: 'test topic');
345345

346346
await checkStartTyping(tester, destinationNarrow);
347347

test/widgets/message_list_test.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,8 @@ void main() {
749749
group('recipient headers', () {
750750
group('StreamMessageRecipientHeader', () {
751751
final stream = eg.stream(name: 'stream name');
752-
final message = eg.streamMessage(stream: stream, topic: 'topic name');
752+
const topic = 'topic name';
753+
final message = eg.streamMessage(stream: stream, topic: topic);
753754

754755
FinderResult<Element> findInMessageList(String text) {
755756
// Stream name shows up in [AppBar] so need to avoid matching that
@@ -808,7 +809,7 @@ void main() {
808809
narrow: const CombinedFeedNarrow(),
809810
messages: [message], subscriptions: [eg.subscription(stream)]);
810811
await store.handleEvent(eg.userTopicEvent(
811-
stream.streamId, message.topic, UserTopicVisibilityPolicy.followed));
812+
stream.streamId, topic, UserTopicVisibilityPolicy.followed));
812813
await tester.pump();
813814
check(find.descendant(
814815
of: find.byType(MessageList),
@@ -820,7 +821,7 @@ void main() {
820821
narrow: TopicNarrow.ofMessage(message),
821822
messages: [message], subscriptions: [eg.subscription(stream, isMuted: true)]);
822823
await store.handleEvent(eg.userTopicEvent(
823-
stream.streamId, message.topic, UserTopicVisibilityPolicy.unmuted));
824+
stream.streamId, topic, UserTopicVisibilityPolicy.unmuted));
824825
await tester.pump();
825826
check(find.descendant(
826827
of: find.byType(MessageList),

0 commit comments

Comments
 (0)