aboutsummaryrefslogtreecommitdiff
path: root/frontend/test/step_request_body_test.dart
diff options
context:
space:
mode:
authorGravatar Reinier van der Leer <pwuts@agpt.co> 2024-01-29 18:29:24 +0100
committerGravatar GitHub <noreply@github.com> 2024-01-29 18:29:24 +0100
commit575be818ca1f7c644e2adf94c584772547141f55 (patch)
treeabb052ae787b1107c9dff8fb4d86ee84842d515d /frontend/test/step_request_body_test.dart
parentUpdate ossf-scorecard.yml (diff)
parentfix(agent/json_utils): Make `extract_dict_from_response` more robust (diff)
downloadAuto-GPT-security/analysis-workflows-sandbox.tar.gz
Auto-GPT-security/analysis-workflows-sandbox.tar.bz2
Auto-GPT-security/analysis-workflows-sandbox.zip
Merge branch 'master' into security/analysis-workflows-sandboxsecurity/analysis-workflows-sandbox
Diffstat (limited to 'frontend/test/step_request_body_test.dart')
-rw-r--r--frontend/test/step_request_body_test.dart26
1 files changed, 26 insertions, 0 deletions
diff --git a/frontend/test/step_request_body_test.dart b/frontend/test/step_request_body_test.dart
new file mode 100644
index 000000000..d15a95f6d
--- /dev/null
+++ b/frontend/test/step_request_body_test.dart
@@ -0,0 +1,26 @@
+import 'package:auto_gpt_flutter_client/models/step_request_body.dart';
+import 'package:flutter_test/flutter_test.dart';
+
+void main() {
+ group('StepRequestBody', () {
+ test('should create StepRequestBody with correct values', () {
+ final stepRequestBody = StepRequestBody(
+ input: 'Execute something', additionalInput: {'key': 'value'});
+
+ expect(stepRequestBody.input, 'Execute something');
+ expect(stepRequestBody.additionalInput, {'key': 'value'});
+ });
+
+ test('should convert StepRequestBody to correct JSON', () {
+ final stepRequestBody = StepRequestBody(
+ input: 'Execute something', additionalInput: {'key': 'value'});
+
+ final json = stepRequestBody.toJson();
+
+ expect(json, {
+ 'input': 'Execute something',
+ 'additional_input': {'key': 'value'}
+ });
+ });
+ });
+}