Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for tween_animation_builder.0.dart API example. #148902

Conversation

ksokolovskyi
Copy link
Contributor

This PR contributes to #130459

Description

  • Adds tests for examples/api/lib/widgets/tween_animation_builder/tween_animation_builder.0.dart

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I signed the [CLA].
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • I followed the [breaking change policy] and added [Data Driven Fixes] where supported.
  • All existing and new tests are passing.

@github-actions github-actions bot added framework flutter/packages/flutter repository. See also f: labels. a: animation Animation APIs d: api docs Issues with https://api.flutter.dev/ d: examples Sample code and demos labels May 22, 2024
@justinmc justinmc requested a review from victorsanni May 24, 2024 21:13
Copy link
Contributor

@victorsanni victorsanni left a comment

Choose a reason for hiding this comment

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

LGTM. I think it might be prudent to add an additional test that the reverse animation is triggered immediately the icon is tapped during the animation (not just at the end), and vice versa. I'm not sure if that's already covered here.

Thanks for writing these tests!

@ksokolovskyi
Copy link
Contributor Author

Hi @victorsanni, thanks for the review!
I added a test that verifies that the animation target can be changed during the animation.

Copy link
Contributor

@gspencergoog gspencergoog left a comment

Choose a reason for hiding this comment

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

32384589-a60f0e74-c078-11e7-9bc1-e5b5287aea9d

),
),
);
}
}

class TweenAnimationBuilderExample extends StatefulWidget {
const TweenAnimationBuilderExample({super.key});
const TweenAnimationBuilderExample({
required this.duration,
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe make this optional, and provide a default duration of 1 second?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@gspencergoog thanks for the review!
In the recent commit I updated the duration to be optional and provided a default value.
Could you please take a look again?

@ksokolovskyi ksokolovskyi force-pushed the add-tween-animation-builder-example-tests branch from 303113f to 64fc8a2 Compare May 29, 2024 11:34
@flutter-dashboard
Copy link

Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change).

If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review.

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Changes reported for pull request #148902 at sha 8fd218b3e208da75cfc8b2adf8d3c0c85edc8c99

@flutter-dashboard flutter-dashboard bot added the will affect goldens Changes to golden files label May 29, 2024
@ksokolovskyi ksokolovskyi force-pushed the add-tween-animation-builder-example-tests branch from 8fd218b to 607ea31 Compare May 29, 2024 16:37
@@ -25,28 +29,35 @@ class TweenAnimationBuilderExampleApp extends StatelessWidget {
}

class TweenAnimationBuilderExample extends StatefulWidget {
const TweenAnimationBuilderExample({super.key});
const TweenAnimationBuilderExample({
this.duration = TweenAnimationBuilderExampleApp.duration,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you can just hard code const Duration(seconds: 1) here as the default. Having it be a separate static reference doesn't add anything to the example, and people will replicate it, which isn't necessarily desirable. Instead of referencing the static in the test, just hardcode it there too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@gspencergoog got it, thanks for the suggestion!

@gspencergoog gspencergoog added the autosubmit Merge PR when tree becomes green via auto submit App label May 30, 2024
@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label May 30, 2024
Copy link
Contributor

auto-submit bot commented May 30, 2024

auto label is removed for flutter/flutter/148902, due to - The status or check suite Google testing has failed. Please fix the issues identified (or deflake) before re-applying this label.

@ksokolovskyi ksokolovskyi force-pushed the add-tween-animation-builder-example-tests branch from a9f778e to e888493 Compare May 30, 2024 17:19
@gspencergoog gspencergoog added the autosubmit Merge PR when tree becomes green via auto submit App label May 30, 2024
@auto-submit auto-submit bot merged commit 488fb09 into flutter:master May 30, 2024
136 checks passed
@ksokolovskyi
Copy link
Contributor Author

@victorsanni @gspencergoog thanks a lot for the review!

victorsanni pushed a commit to victorsanni/flutter that referenced this pull request May 31, 2024
…8902)

This PR contributes to flutter#130459

### Description
- Adds tests for `examples/api/lib/widgets/tween_animation_builder/tween_animation_builder.0.dart`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: animation Animation APIs autosubmit Merge PR when tree becomes green via auto submit App d: api docs Issues with https://api.flutter.dev/ d: examples Sample code and demos framework flutter/packages/flutter repository. See also f: labels. will affect goldens Changes to golden files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants