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.
This commit is contained in:
1 parent
8ead3ff249
commit
6c99366602
4 files changed
+140
No files matched your search
@@ -0,0 +1,20 @@
|
||||
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 Auto connection mode migrates to TUN', () async {
|
||||
SharedPreferences.setMockInitialValues(<String, Object>{
|
||||
'connection_mode': 'auto',
|
||||
'app_routing_mode': 'all',
|
||||
});
|
||||
|
||||
await ConnectionSettings.initialize();
|
||||
|
||||
expect(ConnectionSettings.mode, ConnectionMode.tun);
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
expect(prefs.getString('connection_mode'), ConnectionMode.tun.name);
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user