33 lines
1.1 KiB
Dart
33 lines
1.1 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:ikar/frontend/screens/chats/chat/view/chat_call_banner.dart';
|
|
import 'package:ikar/l10n/app_localizations.dart';
|
|
import 'package:ikar/models/chat_call.dart';
|
|
|
|
void main() {
|
|
for (final floating in [false, true]) {
|
|
testWidgets('call banner joins once, floating=$floating', (tester) async {
|
|
var joined = 0;
|
|
await tester.pumpWidget(MaterialApp(
|
|
locale: const Locale('en'),
|
|
localizationsDelegates: AppLocalizations.localizationsDelegates,
|
|
supportedLocales: AppLocalizations.supportedLocales,
|
|
home: Scaffold(body: ChatCallBanner(
|
|
call: const ChatCall(
|
|
joinLink: 'synthetic-call',
|
|
isVideo: true,
|
|
participantsCount: 3,
|
|
),
|
|
floating: floating,
|
|
onJoin: () => joined++,
|
|
)),
|
|
));
|
|
await tester.pumpAndSettle();
|
|
expect(find.byType(FilledButton), findsOneWidget);
|
|
await tester.tap(find.byType(FilledButton));
|
|
expect(joined, 1);
|
|
expect(tester.takeException(), isNull);
|
|
});
|
|
}
|
|
}
|