forked from eatvio/eatvio_app
feat(video_calls): fixed recinnecting logic, added consultant bage
This commit is contained in:
@@ -17,6 +17,18 @@ void main() {
|
||||
expect(payload.counterpartAvatarUrl, 'https://cdn.example/avatar.jpg');
|
||||
});
|
||||
|
||||
test('parses is_consultant flag from push payload', () {
|
||||
final payload = VideoCallPushPayload.tryParse({
|
||||
'type': 'video_call_incoming',
|
||||
'conversation_uuid': 'abc-123',
|
||||
'caller_name': 'Anna',
|
||||
'is_consultant': 'true',
|
||||
});
|
||||
|
||||
expect(payload, isNotNull);
|
||||
expect(payload!.counterpartIsConsultant, isTrue);
|
||||
});
|
||||
|
||||
test('parses action_url with video-call path', () {
|
||||
final payload = VideoCallPushPayload.tryParse({
|
||||
'action_url': 'https://eatvio.ru/video-call-screen?uuid=room-42',
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import 'package:eatvio_app/features/video_calls/presentation/widgets/video_call_name_chips.dart';
|
||||
import 'package:eatvio_app/generated/l10n.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
@@ -18,4 +20,30 @@ void main() {
|
||||
|
||||
expect(find.text('Alex'), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('VideoCallParticipantNameLabel renders consultant role above name', (tester) async {
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
localizationsDelegates: const [
|
||||
S.delegate,
|
||||
...GlobalMaterialLocalizations.delegates,
|
||||
GlobalWidgetsLocalizations.delegate,
|
||||
],
|
||||
supportedLocales: S.delegate.supportedLocales,
|
||||
home: const Scaffold(
|
||||
body: Stack(
|
||||
children: [
|
||||
VideoCallParticipantNameLabel(
|
||||
name: 'Alex',
|
||||
isConsultant: true,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
expect(find.text('Alex'), findsOneWidget);
|
||||
expect(find.text('Eatvio consultant'), findsOneWidget);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user