feat(video_calls): fixed navigation from voip push

This commit is contained in:
misha
2026-06-17 11:06:22 +03:00
parent 95c1d40c79
commit 65d529b0af
5 changed files with 210 additions and 8 deletions

View File

@@ -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);
});
}