Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

[quick_actions]make QuickActions testable #1067

Merged
merged 15 commits into from Jul 10, 2019

Conversation

The-Redhat
Copy link
Contributor

@The-Redhat The-Redhat commented Jan 12, 2019

Description

I used the same approach like in FirebaseMessaging and added a QuickActions.private constructor used for testing with a mock MethodChannel.

Related Issues

Fixes #25887

Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • My PR includes unit or integration tests for all changed/updated/fixed behaviors (See [Contributor Guide]).
  • All existing and new tests are passing.
  • I updated/added relevant documentation (doc comments with ///).
  • The analyzer (flutter analyze) does not report any problems on my PR.
  • I read and followed the [Flutter Style Guide].
  • The title of the PR starts with the name of the plugin surrounded by square brackets, e.g. [shared_preferences]
  • I updated pubspec.yaml with an appropriate new version according to the [pub versioning philosophy].
  • I updated CHANGELOG.md to add a description of the change.
  • I signed the [CLA].
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • No, this is not a breaking change.

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

@The-Redhat
Copy link
Contributor Author

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

@The-Redhat The-Redhat changed the title made QuickActions testable make QuickActions testable Jan 12, 2019
@cyanglaz cyanglaz changed the title make QuickActions testable [quick_actions]make QuickActions testable Feb 22, 2019
@collinjackson collinjackson self-requested a review March 22, 2019 12:22
Copy link
Contributor

@collinjackson collinjackson left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution!

Please update your pull request following the contribution checklist: https://github.com/flutter/plugins/blob/master/.github/PULL_REQUEST_TEMPLATE.md

In particular, it would be helpful if you could contribute a simple unit test for this plugin and update the pubspec/CHANGELOG, and make sure the bots are happy.

@The-Redhat
Copy link
Contributor Author

The-Redhat commented Mar 22, 2019

Thanks for your answer, since it's my first pr I ask myself what should the unit test consist of ?

@The-Redhat
Copy link
Contributor Author

I made the requested changes!

@amirh amirh added this to Awaiting initial triage in [experimental] Plugins PR tracking Mar 29, 2019
@The-Redhat
Copy link
Contributor Author

Hey, can anybody please look into this pr? Thanks!

@justinmc
Copy link

@The-Redhat Can you merge master into this and fix the conflicts? Then we can try to get a code review for this and get things moving.

@The-Redhat
Copy link
Contributor Author

merged master

Copy link
Contributor

@cyanglaz cyanglaz left a comment

Choose a reason for hiding this comment

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

Thank you for contributing. Did a quick pass. It looks good overall, left some comments.

packages/quick_actions/lib/quick_actions.dart Outdated Show resolved Hide resolved
packages/quick_actions/lib/quick_actions.dart Outdated Show resolved Hide resolved
packages/quick_actions/test/quick_actions_test.dart Outdated Show resolved Hide resolved
packages/quick_actions/lib/quick_actions.dart Outdated Show resolved Hide resolved
@The-Redhat
Copy link
Contributor Author

I made the requested changes

Copy link
Contributor

@cyanglaz cyanglaz left a comment

Choose a reason for hiding this comment

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

LGTM! cc @collinjackson Since you initially looked at this, I'd like to also get a 'go' from you before merging this in.

@collinjackson
Copy link
Contributor

We discussed as a team and we'd like unit tests to be written using setMockMethodCallHandler rather than mockito.

Here's an example unit test:
https://github.com/flutter/plugins/blob/master/packages/cloud_functions/test/cloud_functions_test.dart

Could you please update your unit test to use this style instead?

@The-Redhat
Copy link
Contributor Author

@collinjackson I updated the tests

@collinjackson collinjackson self-requested a review June 20, 2019 18:00
[experimental] Plugins PR tracking automation moved this from Awaiting initial triage to Waiting to land Jun 20, 2019
@The-Redhat
Copy link
Contributor Author

@collinjackson Can I do something to get this pr merged ?

@collinjackson collinjackson merged commit a1867b7 into flutter:master Jul 10, 2019
[experimental] Plugins PR tracking automation moved this from Waiting to land to Done Jul 10, 2019
mithun-mondal pushed a commit to bKash-developer/plugins that referenced this pull request Aug 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
No open projects
5 participants