Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
sydneyjodon-wk committed Dec 1, 2023
1 parent 0c1eabb commit a17cee0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
8 changes: 3 additions & 5 deletions lib/src/component_declaration/component_base.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit a17cee0

Please sign in to comment.