fix(digital-id): завершать ЕСИА callback через EXTERNAL_CALLBACK

This commit is contained in:
klockky
2026-07-24 14:38:19 +03:00
parent 164ab98fb7
commit f7265b4fe8
5 changed files with 141 additions and 23 deletions
+34
View File
@@ -0,0 +1,34 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:komet/backend/modules/webapp.dart';
void main() {
group('ExternalCallbackResult', () {
test('parses callback response fields', () {
final result = ExternalCallbackResult.fromPayload({
'botId': '123456',
'startParam': 'esia-complete',
});
expect(result?.botId, 123456);
expect(result?.startParam, 'esia-complete');
});
test('parses a nested protocol response', () {
final result = ExternalCallbackResult.fromPayload({
'data': {'bot_id': 42, 'start_param': 'done'},
});
expect(result?.botId, 42);
expect(result?.startParam, 'done');
});
test('rejects a response without a bot id', () {
expect(
ExternalCallbackResult.fromPayload({
'data': {'startParam': 'done'},
}),
isNull,
);
});
});
}