refactor: improve fullscreen_media, minor changes.

Signed-off-by: xsahil03x <[email protected]>
This commit is contained in:
Sahil Kumar
2023-07-28 21:07:02 +05:30
committed by xsahil03x
parent 572207c354
commit 93b4158897
12 changed files with 135 additions and 465 deletions
@@ -1,25 +0,0 @@
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
import '../mocks.dart';
void main() {
testWidgets('AttachmentError test', (tester) async {
await tester.pumpWidget(
MaterialApp(
builder: (context, child) => StreamChat(
client: MockClient(),
child: child,
),
home: const Scaffold(
body: Center(
child: AttachmentError(),
),
),
),
);
expect(find.byType(Icon), findsOneWidget);
});
}
@@ -1,42 +0,0 @@
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
import '../mocks.dart';
void main() {
testWidgets('AttachmentTitle renders properly', (tester) async {
final mockClient = MockClient();
await tester.pumpWidget(
MaterialApp(
builder: (context, child) => StreamChat(
client: mockClient,
streamChatThemeData: StreamChatThemeData.light(),
child: child,
),
home: Scaffold(
body: Builder(
builder: (context) {
return Center(
child: StreamAttachmentTitle(
attachment: Attachment(
title: 'Test Attachment',
type: 'video',
titleLink: 'https://www.youtube.com/watch?v=lytQi-slT5Y',
ogScrapeUrl: 'https://www.youtube.com/watch?v=lytQi-slT5Y',
),
messageTheme: StreamChatTheme.of(context).ownMessageTheme,
),
);
},
),
),
),
);
expect(find.byType(StreamAttachmentTitle), findsOneWidget);
expect(find.text('Test Attachment'), findsOneWidget);
expect(find.text('https://www.youtube.com/watch?v=lytQi-slT5Y'),
findsOneWidget);
});
}