forked from eatvio/eatvio_app
Merge remote-tracking branch 'upstream/main' into issue-975
This commit is contained in:
@@ -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>>());
|
||||
|
||||
Reference in New Issue
Block a user