Skip to content

Commit 07e1a35

Browse files
authored
fix(core): unable to pass non initialized channels in StreamChannel (#2157)
* fix(core): unable to pass non initialized channels in StreamChannel * chore: update CHANGELOG.md * chore: update CHANGELOG.md * refactor: make it non-breaking * chore: replace id with cid * test: recreate tests for new impl * chore: fix lint * chore: revert sample app change needed * test: fix tests * chore: trigger build * chore: commit generated_plugins.cmake
1 parent d16844a commit 07e1a35

27 files changed

+555
-299
lines changed

packages/stream_chat_flutter/example/windows/flutter/generated_plugins.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ list(APPEND FLUTTER_PLUGIN_LIST
99
gal
1010
media_kit_video
1111
record_windows
12-
screen_brightness_windows
1312
share_plus
1413
sqlite3_flutter_libs
1514
thumblr_windows
1615
url_launcher_windows
16+
volume_controller
1717
)
1818

1919
list(APPEND FLUTTER_FFI_PLUGIN_LIST

packages/stream_chat_flutter/test/src/attachment/file_attachment_test.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ void main() {
4444
),
4545
);
4646

47+
// wait for the initial state to be rendered.
48+
await tester.pumpAndSettle();
49+
4750
expect(find.text('example.pdf'), findsOneWidget);
4851
},
4952
);

packages/stream_chat_flutter/test/src/attachment/gallery_attachment_test.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ void main() {
7070
),
7171
);
7272

73+
// wait for the initial state to be rendered.
74+
await tester.pump(Duration.zero);
75+
7376
expect(find.byType(CachedNetworkImage), findsNWidgets(2));
7477
},
7578
);

packages/stream_chat_flutter/test/src/attachment/giphy_attachment_test.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ void main() {
4747
),
4848
);
4949

50+
// wait for the initial state to be rendered.
51+
await tester.pump(Duration.zero);
52+
5053
expect(find.text('GIPHY'), findsOneWidget);
5154
},
5255
);

packages/stream_chat_flutter/test/src/attachment/image_attachment_test.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ void main() {
4747
),
4848
);
4949

50+
// wait for the initial state to be rendered.
51+
await tester.pump(Duration.zero);
52+
5053
expect(find.byType(CachedNetworkImage), findsOneWidget);
5154
},
5255
);

packages/stream_chat_flutter/test/src/attachment/url_attachment_test.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ void main() {
3939
),
4040
);
4141

42+
// wait for the initial state to be rendered.
43+
await tester.pumpAndSettle();
44+
4245
expect(find.text('Flutter'), findsOneWidget);
4346
},
4447
);

packages/stream_chat_flutter/test/src/avatars/group_avatar_test.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ void main() {
9393
),
9494
);
9595

96+
// wait for the initial state to be rendered.
97+
await tester.pumpAndSettle();
98+
9699
expect(find.byType(StreamUserAvatar), findsNWidgets(2));
97100
},
98101
);

packages/stream_chat_flutter/test/src/channel/channel_header_test.dart

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ void main() {
6868
),
6969
);
7070

71+
// wait for the initial state to be rendered.
72+
await tester.pumpAndSettle();
73+
7174
expect(find.text('test'), findsOneWidget);
7275
expect(find.byType(StreamChannelAvatar), findsOneWidget);
7376
expect(find.byType(StreamBackButton), findsOneWidget);
@@ -140,6 +143,9 @@ void main() {
140143
),
141144
);
142145

146+
// wait for the initial state to be rendered.
147+
await tester.pumpAndSettle();
148+
143149
expect(
144150
tester
145151
.widget<StreamInfoTile>(find.byType(StreamInfoTile))
@@ -294,6 +300,9 @@ void main() {
294300
),
295301
);
296302

303+
// wait for the initial state to be rendered.
304+
await tester.pumpAndSettle();
305+
297306
expect(find.text('test'), findsNothing);
298307
expect(find.byType(StreamBackButton), findsNothing);
299308
expect(find.byType(StreamChannelAvatar), findsNothing);
@@ -368,6 +377,9 @@ void main() {
368377
),
369378
);
370379

380+
// wait for the initial state to be rendered.
381+
await tester.pumpAndSettle();
382+
371383
expect(find.byType(StreamBackButton), findsNothing);
372384
expect(
373385
tester
@@ -452,6 +464,9 @@ void main() {
452464
),
453465
);
454466

467+
// wait for the initial state to be rendered.
468+
await tester.pump(Duration.zero);
469+
455470
await tester.tap(find.byType(StreamBackButton));
456471
await tester.tap(find.byType(StreamChannelAvatar));
457472
await tester.tap(find.byType(StreamChannelName));

packages/stream_chat_flutter/test/src/channel/channel_image_test.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ void main() {
3939
),
4040
);
4141

42+
// wait for the initial state to be rendered.
43+
await tester.pumpAndSettle();
44+
4245
final image =
4346
tester.widget<CachedNetworkImage>(find.byType(CachedNetworkImage));
4447
expect(image.imageUrl, 'https://bit.ly/321RmWb');
@@ -115,6 +118,9 @@ void main() {
115118
),
116119
);
117120

121+
// wait for the initial state to be rendered.
122+
await tester.pumpAndSettle();
123+
118124
final image =
119125
tester.widget<CachedNetworkImage>(find.byType(CachedNetworkImage));
120126
expect(image.imageUrl, 'testimage');
@@ -178,6 +184,9 @@ void main() {
178184
),
179185
);
180186

187+
// wait for the initial state to be rendered.
188+
await tester.pumpAndSettle();
189+
181190
final image =
182191
tester.widget<StreamGroupAvatar>(find.byType(StreamGroupAvatar));
183192
final otherMembers = members.where((it) => it.userId != currentUser.id);
@@ -223,6 +232,9 @@ void main() {
223232
),
224233
);
225234

235+
// wait for the initial state to be rendered.
236+
await tester.pumpAndSettle();
237+
226238
expect(find.byKey(const Key('selectedImage')), findsOneWidget);
227239
},
228240
);

packages/stream_chat_flutter/test/src/channel/channel_name_test.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ void main() {
7272
),
7373
);
7474

75+
// wait for the initial state to be rendered.
76+
await tester.pumpAndSettle();
77+
7578
expect(find.text('test'), findsOneWidget);
7679
},
7780
);

0 commit comments

Comments
 (0)