From a17cee051703d918c1e868954c4f1dab9338326b Mon Sep 17 00:00:00 2001 From: Sydney Jodon Date: Fri, 1 Dec 2023 12:21:10 -0700 Subject: [PATCH] Fix warnings --- lib/src/component_declaration/component_base.dart | 8 +++----- .../null_safety_validate_required_props_test.dart | 2 -- .../null_safety_validate_required_props_test.dart | 2 -- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/lib/src/component_declaration/component_base.dart b/lib/src/component_declaration/component_base.dart index 58b807865..8e6fbd29b 100644 --- a/lib/src/component_declaration/component_base.dart +++ b/lib/src/component_declaration/component_base.dart @@ -622,6 +622,7 @@ abstract class UiProps extends MapBase assert(_validateChildren(childArguments.length == 1 ? childArguments.single : childArguments)); // FIXME(null-safety) finalize this implementation and add escape-hatch to opt out in FED-1886 + // todo find out about assert vs devMode if(_shouldValidateRequiredProps) { assert(() { validateRequiredProps(); @@ -684,16 +685,13 @@ abstract class UiProps extends MapBase @mustCallSuper void validateRequiredProps() {} - // todo doc comment + /// Whether [validateRequiredProps] should be run. var _shouldValidateRequiredProps = true; /// Prevents [validateRequiredProps] from being called. /// - /// Allows for an element to have multiple test IDs to prevent overwriting when cloning elements or components. - /// - /// > For use in a testing environment (when [testMode] is true). + /// Allows validation to be skipped to support cases where required props are cloned onto an element. void disableRequiredPropValidation() { - // todo should this also override proptype warnings?? _shouldValidateRequiredProps = false; } } diff --git a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/null_safety_validate_required_props_test.dart b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/null_safety_validate_required_props_test.dart index 457604e0a..91bed3c30 100644 --- a/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/null_safety_validate_required_props_test.dart +++ b/test/over_react/component_declaration/builder_integration_tests/backwards_compatible/null_safety_validate_required_props_test.dart @@ -16,8 +16,6 @@ import 'package:over_react/over_react.dart'; import 'package:react_testing_library/react_testing_library.dart' as rtl; import 'package:test/test.dart'; -import '../../../../test_util/test_util.dart'; - part 'null_safety_validate_required_props_test.over_react.g.dart'; void main() { diff --git a/test/over_react/component_declaration/builder_integration_tests/null_safety_validate_required_props_test.dart b/test/over_react/component_declaration/builder_integration_tests/null_safety_validate_required_props_test.dart index 6e7a16db7..975503de1 100644 --- a/test/over_react/component_declaration/builder_integration_tests/null_safety_validate_required_props_test.dart +++ b/test/over_react/component_declaration/builder_integration_tests/null_safety_validate_required_props_test.dart @@ -16,8 +16,6 @@ import 'package:over_react/over_react.dart'; import 'package:react_testing_library/react_testing_library.dart' as rtl; import 'package:test/test.dart'; -import '../../../test_util/test_util.dart'; - part 'null_safety_validate_required_props_test.over_react.g.dart'; void main() {