Skip to content

Commit

Permalink
testcase updated
Browse files Browse the repository at this point in the history
  • Loading branch information
sher999 committed Dec 11, 2024
1 parent cfe12e0 commit a2a1fb5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion test/widgets/content_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,17 @@ void main() {
TestZulipBinding.ensureInitialized();

Widget plainContent(String html) {
final narrow = TopicNarrow.ofMessage(eg.streamMessage());
return Builder(builder: (context) =>
DefaultTextStyle(
style: ContentTheme.of(context).textStylePlainParagraph,
child: BlockContentList(nodes: parseContent(html).nodes)));
child: BlockContentList(nodes: parseContent(html).nodes,narrow:narrow)));
}

Widget messageContent(String html) {
final narrow = TopicNarrow.ofMessage(eg.streamMessage());
return MessageContent(message: eg.streamMessage(content: html),
narrow:narrow,
content: parseContent(html));
}

Expand Down
4 changes: 3 additions & 1 deletion test/widgets/lightbox_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import 'package:video_player_platform_interface/video_player_platform_interface.
import 'package:video_player/video_player.dart';
import 'package:zulip/api/model/model.dart';
import 'package:zulip/model/localizations.dart';
import 'package:zulip/model/narrow.dart';
import 'package:zulip/widgets/app.dart';
import 'package:zulip/widgets/content.dart';
import 'package:zulip/widgets/lightbox.dart';
Expand Down Expand Up @@ -199,7 +200,7 @@ void main() {

group('_ImageLightboxPage', () {
final src = Uri.parse('https://chat.example/lightbox-image.png');

final narrow = TopicNarrow.ofMessage(eg.streamMessage());
Future<void> setupPage(WidgetTester tester, {
Message? message,
required Uri? thumbnailUrl,
Expand All @@ -220,6 +221,7 @@ void main() {
thumbnailUrl: thumbnailUrl,
originalHeight: null,
originalWidth: null,
narrow:narrow
)));
await tester.pump(); // per-account store
await tester.pump(const Duration(milliseconds: 301)); // nav transition
Expand Down

0 comments on commit a2a1fb5

Please sign in to comment.