feat(sbp_payments): added banks deep link handling to chat screen

This commit is contained in:
misha
2026-07-14 13:09:18 +03:00
parent be924265a1
commit 0ca2d1a1cc
10 changed files with 234 additions and 29 deletions

View File

@@ -1,4 +1,5 @@
import 'package:eatvio_app/core/app_router.dart';
import 'package:eatvio_app/core/routing/route_constants.dart';
import 'package:eatvio_app/features/auth/entities/auth_result_entity.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
@@ -6,6 +7,50 @@ import 'package:go_router/go_router.dart';
void main() {
group('AppRouter', () {
group('resolveDeepLinkTarget - finance/alfa/return', () {
const orderId = 'alfa_c29_k15138_t1712345678_r1234';
test('finance/alfa/return/{orderId} → chat-screen?orderId=', () {
final target = AppRouter.resolveDeepLinkTarget(
Uri.parse('https://eatvio.ru/finance/alfa/return/$orderId'),
);
expect(target, '${RouteConstants.chatScreen}?orderId=$orderId');
});
test('ru/finance/alfa/return/{orderId} → chat-screen?orderId= (metaSegments)', () {
final target = AppRouter.resolveDeepLinkTarget(
Uri.parse('https://eatvio.ru/ru/finance/alfa/return/$orderId'),
);
expect(target, '${RouteConstants.chatScreen}?orderId=$orderId');
});
test('неполный path /finance/alfa → feed', () {
final target = AppRouter.resolveDeepLinkTarget(
Uri.parse('https://eatvio.ru/finance/alfa'),
);
expect(target, RouteConstants.feedScreen);
});
test('неполный path /finance → feed', () {
final target = AppRouter.resolveDeepLinkTarget(
Uri.parse('https://eatvio.ru/finance'),
);
expect(target, RouteConstants.feedScreen);
});
test('регресс: chat/{uuid} → chat-screen?uuid=', () {
final target = AppRouter.resolveDeepLinkTarget(
Uri.parse('https://eatvio.ru/ru/chat/uuid-1'),
);
expect(target, '${RouteConstants.chatScreen}?uuid=uuid-1');
});
});
test('navigatorKey инициализирован', () {
expect(AppRouter.navigatorKey, isNotNull);
expect(AppRouter.navigatorKey, isA<GlobalKey<NavigatorState>>());