Skip to content

Commit

Permalink
fix assertion logic
Browse files Browse the repository at this point in the history
  • Loading branch information
kealjones-wk committed Aug 9, 2023
1 parent b20ec36 commit a068cbb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/src/component_declaration/builder_helpers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ extension PropsToForward<T extends UiProps> on T {
consumedProps = staticMeta.forMixins(exclude ?? {T}).toList();
} catch(_) {
// If [domOnly] is `true`, it is alright for the meta lookup to fail, otherwise throw the error.
assert(exclude == null && domOnly == true, ArgumentError('Could not find props meta for type $T.'
assert(exclude != null, ArgumentError('Could not find props meta for type $T.'
' If this is not a props mixin, you need to specify its mixins as the second argument. For example:'
'\n ..addAll(props.getPropsToForward(exclude: {${T}Mixin})').message);
rethrow;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ testPropsToForward({UiFactory<TestProps> factory, bool modifyProps = false}) {
});

test('for dom only ', () {
var unconsumedProps = _propsToForward(domOnly: true, props: initialProps, factory: factory, modifyProps: modifyProps);
var unconsumedProps = _propsToForward(exclude: {}, domOnly: true, props: initialProps, factory: factory, modifyProps: modifyProps);

expect(unconsumedProps.stringProp, isNull);
expect(unconsumedProps.anotherProp, isNull);
Expand Down

0 comments on commit a068cbb

Please sign in to comment.