Malarg commented on code in PR #24283:
URL: https://github.com/apache/beam/pull/24283#discussion_r1034356347
##########
playground/frontend/playground_components/test/src/controllers/snippet_editing_controllers_test.dart:
##########
@@ -0,0 +1,55 @@
+import 'package:flutter_test/flutter_test.dart';
+import
'package:playground_components/src/controllers/snippet_editing_controller.dart';
+import 'package:playground_components/src/models/sdk.dart';
+
+import '../common/examples.dart';
+
Review Comment:
fixed
##########
playground/frontend/playground_components/test/src/controllers/snippet_editing_controllers_test.dart:
##########
@@ -0,0 +1,55 @@
+import 'package:flutter_test/flutter_test.dart';
+import
'package:playground_components/src/controllers/snippet_editing_controller.dart';
+import 'package:playground_components/src/models/sdk.dart';
+
+import '../common/examples.dart';
+
+void main() {
+ group(
+ 'Snippet editing controllers',
+ () {
+ test(
+ 'Returns standard descriptor if code has not been changed',
+ () {
+ final controller = SnippetEditingController(sdk: Sdk.python);
+ controller.selectedExample = exampleMock1;
+
+ final descriptor = controller.getLoadingDescriptor();
+
+ expect(descriptor.toJson(), {'example':
'SDK_PYTHON/Category/Name1'});
+ },
+ );
+
+ test(
+ 'Returns content descriptor if code has been changed',
+ () {
+ final controller = SnippetEditingController(sdk: Sdk.python);
+ controller.selectedExample = exampleMock1;
+
+ controller.codeController.value = const TextEditingValue(text:
'ex4');
+ final descriptor = controller.getLoadingDescriptor();
+
+ expect(descriptor.toJson(), {
+ 'sdk': 'python',
+ 'content': 'ex4',
+ 'name': 'Example X1',
+ 'complexity': 'basic'
Review Comment:
fixed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]