Files
ReVoltVPN/test/no_ass_migration_test.dart
T
Naveax 6c99366602 test(app): cover routing and secure socks migrations
Cover legacy Auto and ASS preference migration, authenticated SOCKS session generation and the stock-runtime Xray SOCKS schema so future runtime changes cannot silently restore the old fixed-port/no-auth behavior.
2026-08-31 19:47:05 +03:00

28 lines
855 B
Dart

import 'package:flutter_test/flutter_test.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:revoltvpn/logic/connection_settings.dart';
void main() {
TestWidgetsFlutterBinding.ensureInitialized();
test('legacy ASS migrates to SOCKS5 selected-only without losing packages', () async {
SharedPreferences.setMockInitialValues(<String, Object>{
'connection_mode': 'ass',
'app_routing_mode': 'selected',
'app_routing_packages': <String>[
'com.android.chrome',
'com.discord',
],
});
await ConnectionSettings.initialize();
expect(ConnectionSettings.mode, ConnectionMode.proxy);
expect(ConnectionSettings.routingMode, AppRoutingMode.selected);
expect(
ConnectionSettings.appPackages,
<String>['com.android.chrome', 'com.discord'],
);
});
}