Skip to content

Commit

Permalink
fixup! test: add tests for reworked InteractionInput class
Browse files Browse the repository at this point in the history
  • Loading branch information
JKRhb committed Dec 29, 2023
1 parent 8b14234 commit a04ee5f
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions test/scripting_api/interaction_input_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,40 @@ void main() {
DataSchemaValue.fromInteger(testValue),
);
});

test('from Number', () {
const testValue = 42.0;
final interactionInput = InteractionInput.fromNumber(testValue);

expect(interactionInput, isA<DataSchemaValueInput>());

expect(
(interactionInput as DataSchemaValueInput).dataSchemaValue,
isA<NumberValue>(),
);

expect(
interactionInput.dataSchemaValue,
DataSchemaValue.fromNumber(testValue),
);
});

test('from boolean', () {
const testValue = true;
final interactionInput = InteractionInput.fromBoolean(testValue);

expect(interactionInput, isA<DataSchemaValueInput>());

expect(
(interactionInput as DataSchemaValueInput).dataSchemaValue,
isA<BooleanValue>(),
);

expect(
interactionInput.dataSchemaValue,
DataSchemaValue.fromBoolean(testValue),
);
});
});
});
}

0 comments on commit a04ee5f

Please sign in to comment.