Files
jinzhi/test/features/mall/mall_bridge_arguments_test.dart
T
2026-09-08 14:27:32 +08:00

40 lines
1.4 KiB
Dart

import 'package:flutter_test/flutter_test.dart';
import 'package:jinzhi_flutter_app/features/mall/application/mall_tab_config.dart';
void main() {
test('preserves Jinzhi attribution while syncing H5 login', () {
final arguments = buildEnterWebMallBridgeArguments(
currentUri: Uri.parse(
'https://mall.example.com/?from=jinzhi&source_app=jinzhi'
'&source_entry=market_quote&placement=mall_tab&hook_type=quote_cta'
'&entry_scene=retail&entry_metal=au'
'&tracking_id=tracking&click_id=click-1&ts=123&isNight=0',
),
logged: true,
isDark: true,
authToken: 'mall-token',
scene: 'web_mall',
sourceApp: 'jinzhi',
attribution: const MallClickAttribution(
adId: 'latest-ad',
trackingId: 'latest-tracking',
clickId: 'latest-click',
),
);
expect(arguments['from'], 'jinzhi');
expect(arguments['source_app'], 'jinzhi');
expect(arguments['source_entry'], 'market_quote');
expect(arguments['hook_type'], 'quote_cta');
expect(arguments['entry_scene'], 'retail');
expect(arguments['entry_metal'], 'au');
expect(arguments['ad_id'], 'latest-ad');
expect(arguments['tracking_id'], 'latest-tracking');
expect(arguments['click_id'], 'latest-click');
expect(arguments['isNight'], '1');
expect(arguments['auth_token'], 'mall-token');
expect(arguments['authToken'], 'mall-token');
expect(arguments['scene'], 'web_mall');
});
}