forked from eatvio/eatvio_app
feat(video_calls): fixed navigation from voip push
This commit is contained in:
@@ -3,8 +3,12 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('insertBanner shows message and can be removed manually', (tester) async {
|
||||
await tester.pumpWidget(const MaterialApp(home: Scaffold(body: SizedBox.shrink())));
|
||||
testWidgets('insertBanner shows message and can be removed manually', (
|
||||
tester,
|
||||
) async {
|
||||
await tester.pumpWidget(
|
||||
const MaterialApp(home: Scaffold(body: SizedBox.shrink())),
|
||||
);
|
||||
|
||||
final context = tester.element(find.byType(SizedBox));
|
||||
final entry = VideoCallTopOverlay.insertBanner(
|
||||
@@ -23,7 +27,9 @@ void main() {
|
||||
});
|
||||
|
||||
testWidgets('insertBanner auto removes entry', (tester) async {
|
||||
await tester.pumpWidget(const MaterialApp(home: Scaffold(body: SizedBox.shrink())));
|
||||
await tester.pumpWidget(
|
||||
const MaterialApp(home: Scaffold(body: SizedBox.shrink())),
|
||||
);
|
||||
|
||||
final context = tester.element(find.byType(SizedBox));
|
||||
VideoCallTopOverlay.insertBanner(
|
||||
@@ -40,4 +46,25 @@ void main() {
|
||||
await tester.pump(const Duration(milliseconds: 40));
|
||||
expect(find.text('Muted mic'), findsNothing);
|
||||
});
|
||||
|
||||
testWidgets('insertBanner does not throw without an overlay', (tester) async {
|
||||
await tester.pumpWidget(
|
||||
const Directionality(
|
||||
textDirection: TextDirection.ltr,
|
||||
child: SizedBox.shrink(),
|
||||
),
|
||||
);
|
||||
|
||||
final context = tester.element(find.byType(SizedBox));
|
||||
final entry = VideoCallTopOverlay.insertBanner(
|
||||
context,
|
||||
message: 'Recording notice',
|
||||
backgroundColor: Colors.grey,
|
||||
svgAsset: VideoCallTopOverlay.warningSvg,
|
||||
);
|
||||
|
||||
expect(entry.mounted, isFalse);
|
||||
await tester.pump();
|
||||
expect(find.text('Recording notice'), findsNothing);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user