Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sydneyjodon-wk committed Jul 22, 2024
1 parent 79138d3 commit 9970e2f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/vm_tests/builder/codegen_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1186,7 +1186,7 @@ main() {
});

group('an unsupported usage of @ConvertProp', () {
const basicUnsupportedPropComboMessage = 'Unsupported prop annotation combination for prop foo: A prop annotated with `@Convert<Raw, Converted>(setter, getter)` should have the same type as the `Converted` generic parameter.';
const basicUnsupportedPropComboMessage = 'Unsupported prop annotation combination for prop \'foo\': A prop annotated with `@Convert<Raw, Converted>(setter, getter)` should have the same type as the `Converted` generic parameter.';

test('the prop type does not match the Converted type', () {
var body = '''
Expand All @@ -1203,7 +1203,7 @@ main() {
late String foo;''';

setUpAndGenerate(OverReactSrc.abstractProps(backwardsCompatible: false, body: body).source);
verify(() => logger.severe(contains('Unsupported prop annotation combination for prop foo: The @ConvertProp annotation must be used with generic parameters: `@Convert<Raw, Converted>(setter, getter)`')));
verify(() => logger.severe(contains('Unsupported prop annotation combination for prop \'foo\': The @ConvertProp annotation must be used with generic parameters: `@Convert<Raw, Converted>(setter, getter)`')));
});

test('the setter is null', () {
Expand All @@ -1230,7 +1230,7 @@ main() {
late String foo;''';

setUpAndGenerate(OverReactSrc.abstractProps(backwardsCompatible: false, body: body).source);
verify(() => logger.severe(contains('Unsupported prop annotation combination for prop foo: A prop annotated with `@convertJsMapProp` should be typed as `Map?`.')));
verify(() => logger.severe(contains('Unsupported prop annotation combination for prop \'foo\': A prop annotated with `@convertJsMapProp` should be typed as `Map?`.')));
});

test('@convertJsRefProp of the wrong prop type', () {
Expand All @@ -1239,7 +1239,7 @@ main() {
Map? foo;''';

setUpAndGenerate(OverReactSrc.abstractProps(backwardsCompatible: false, body: body).source);
verify(() => logger.severe(contains('Unsupported prop annotation combination for prop foo: A prop annotated with `@convertJsRefProp` should be typed as `dynamic`.')));
verify(() => logger.severe(contains('Unsupported prop annotation combination for prop \'foo\': A prop annotated with `@convertJsRefProp` should be typed as `dynamic`.')));
});
});
});
Expand Down

0 comments on commit 9970e2f

Please sign in to comment.