Skip to content

Conversation

Sahil-Simform
Copy link
Collaborator

Description

  • Added test cases to check utilities values

Checklist

  • The title of my PR starts with a Conventional Commit prefix (fix:, feat:, docs: etc).
  • I have followed the Contributor Guide when preparing my PR.
  • I have updated/added tests for ALL new/updated/fixed functionality.
  • I have updated/added relevant documentation in docs and added dartdoc comments with ///.
  • I have updated/added relevant examples in examples or docs.

Breaking Change?

  • Yes, this PR is a breaking change.
  • No, this PR is not a breaking change.

Related Issues

Constants.defaultProgressIndicator,
isA<ShowcaseCircularProgressIndicator>(),
);
expect(Constants.defaultTargetShapeBorder, isA<RoundedRectangleBorder>());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check the borderRadius as well.

});

test(
'Constants progress indicator is instance of ShowcaseCircularProgressIndicator',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already covered.

expect(progressIndicator, isA<ShowcaseCircularProgressIndicator>());
});

test('Constants target shape border is instance of RoundedRectangleBorder',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already covered.

expect(TooltipPosition.right.toString(), 'TooltipPosition.right');
});

test('TooltipPosition enum equality', () {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

== operator can't be overridden for an enum so this check seems unnecessary.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not all enums are covered.

});
});

group('Enum Tests', () {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can test for enum's properties' default values too.

expect(find.text('Target Widget'), findsOneWidget);
});

testWidgets('Floating action widget integration',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already covered. Doesn't qualify as an integration test.

});

group('Error Handling Tests', () {
testWidgets('Invalid overlay opacity throws assertion error',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test doesn't fall under utils.

);
});

testWidgets('Invalid targetTooltipGap throws assertion error',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test doesn't fall under utils.

});

testWidgets(
'Invalid disposeOnTap and onTargetClick combination throws assertion error',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test doesn't fall under utils.

});

testWidgets(
'Invalid onBarrierClick and disableBarrierInteraction combination throws assertion error',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test doesn't fall under utils.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants