Skip to content

Add tests for shortcuts.dart API examples. - #147433

Merged
auto-submit[bot] merged 3 commits into
flutter:masterfrom
ksokolovskyi:add-shortcuts-example-tests
May 7, 2024
Merged

auto-submit[bot] merged 3 commits into
flutter:masterfrom
ksokolovskyi:add-shortcuts-example-tests

Conversation

@ksokolovskyi

@ksokolovskyi ksokolovskyi commented Apr 26, 2024 •

Copy link
Copy Markdown
Contributor

This PR contributes to #130459

Description

  • Adds tests for examples/api/lib/widgets/shortcuts/shortcuts.0.dart
  • Adds tests for examples/api/lib/widgets/shortcuts/shortcuts.1.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. d: api docs Issues with https://api.flutter.dev/ d: examples Sample code and demos labels Apr 26, 2024
@goderbauer
goderbauer requested a review from Piinks April 30, 2024 22:15

@bleroux bleroux left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM! Thanks for the contribution.

@ksokolovskyi
ksokolovskyi force-pushed the add-shortcuts-example-tests branch 3 times, most recently from d371abf to 756a7d8 Compare May 5, 2024 08:56
@bleroux
bleroux force-pushed the add-shortcuts-example-tests branch from 756a7d8 to f74e6a1 Compare May 7, 2024 07:55
@bleroux
bleroux requested a review from TahaTesser May 7, 2024 08:58
Comment thread examples/api/test/widgets/shortcuts/shortcuts.0_test.dart Outdated
Comment thread examples/api/test/widgets/shortcuts/shortcuts.1_test.dart Outdated
Comment thread examples/api/test/widgets/shortcuts/shortcuts.1_test.dart Outdated
Comment thread examples/api/test/widgets/shortcuts/shortcuts.0_test.dart Outdated
@ksokolovskyi

Copy link
Copy Markdown
Contributor Author

Hi @bleroux @TahaTesser thanks a lot for the review!

@ksokolovskyi

Copy link
Copy Markdown
Contributor Author

@TahaTesser thanks for the replies and examples. I updated the tests according to your feedback. Could you please take a look again?

@ksokolovskyi
ksokolovskyi requested a review from TahaTesser May 7, 2024 10:27

@TahaTesser TahaTesser left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM! With updated titles

expect(find.text('count: 0'), findsOneWidget);
});

testWidgets('updates counter on arrowUp and arrowDown press', (WidgetTester tester) async {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
testWidgets('updates counter on arrowUp and arrowDown press', (WidgetTester tester) async {
testWidgets(' Up and down arrow press updates counter', (WidgetTester tester) async {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Similar title in other test

import 'package:flutter_test/flutter_test.dart';

void main() {
testWidgets('displays correct labels', (WidgetTester tester) async {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
testWidgets('displays correct labels', (WidgetTester tester) async {
testWidgets('Verify correct labels are displayed', (WidgetTester tester) async {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Similar title in other test

@ksokolovskyi
ksokolovskyi requested a review from TahaTesser May 7, 2024 10:37
@TahaTesser TahaTesser added the autosubmit Merge PR when tree becomes green via auto submit App label May 7, 2024
@auto-submit
auto-submit Bot merged commit 28e65b7 into flutter:master May 7, 2024
@ksokolovskyi

Copy link
Copy Markdown
Contributor Author

@bleroux @TahaTesser thanks for the review!

engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 7, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 7, 2024
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request May 7, 2024
flutter/flutter@04424e1...7920a52

2024-05-07 [email protected] Add tests for callback_shortcuts.0.dart API example. (flutter/flutter#147536)
2024-05-07 [email protected] Improve Android SDK and NDK mistmatch warning message (flutter/flutter#147809)
2024-05-07 [email protected] Add tests for shortcuts.dart API examples. (flutter/flutter#147433)
2024-05-07 [email protected] Added missing tests for ButtonStyle example (flutter/flutter#147457)
2024-05-07 [email protected] Roll Flutter Engine from ece1d686e3ba to 150f694a7816 (1 revision) (flutter/flutter#147912)
2024-05-07 [email protected] DropdownMenu cleanup (flutter/flutter#147860)
2024-05-07 [email protected] Roll Flutter Engine from 80470584e1e1 to ece1d686e3ba (1 revision) (flutter/flutter#147910)
2024-05-07 [email protected] Roll Flutter Engine from b7bfd94af743 to 80470584e1e1 (1 revision) (flutter/flutter#147906)
2024-05-07 [email protected] Roll Flutter Engine from b64e2300bcd0 to b7bfd94af743 (1 revision) (flutter/flutter#147905)
2024-05-07 [email protected] fix MenuItemButton if child is null  (flutter/flutter#147485)
2024-05-07 [email protected] Fix document generation, eliminate template support from snippets tool. (flutter/flutter#147893)
2024-05-07 [email protected] Roll Flutter Engine from 4cb9e02c06ce to b64e2300bcd0 (1 revision) (flutter/flutter#147904)
2024-05-07 [email protected] test focus example 0 (flutter/flutter#147564)
2024-05-07 [email protected] Roll Flutter Engine from 422f92b992c5 to 4cb9e02c06ce (1 revision) (flutter/flutter#147899)
2024-05-06 [email protected] Roll pub packages (flutter/flutter#147896)
2024-05-06 [email protected] Roll Flutter Engine from 463ff7d2d4d5 to 422f92b992c5 (5 revisions) (flutter/flutter#147895)
2024-05-06 [email protected] MultiSelectableSelectionContainerDelegate documentation fixes. (flutter/flutter#147843)
2024-05-06 [email protected] Roll pub packages (flutter/flutter#147891)
2024-05-06 49699333+dependabot[bot]@users.noreply.github.com Bump actions/checkout from 4.1.4 to 4.1.5 (flutter/flutter#147888)
2024-05-06 [email protected] Fix janks and memory leaks in `CupertinoPageTransition` and `CupertinoFullscreenDialogTransition` (flutter/flutter#146999)
2024-05-06 [email protected] Roll Flutter Engine from 960a0c8fecbe to 463ff7d2d4d5 (1 revision) (flutter/flutter#147886)
2024-05-06 [email protected] Roll Flutter Engine from 70cc300f9ad8 to 960a0c8fecbe (1 revision) (flutter/flutter#147884)
2024-05-06 [email protected] [new gallery] Reisze gallery images (flutter/flutter#147882)
2024-05-06 [email protected] Roll Flutter Engine from d0f99b35eac6 to 70cc300f9ad8 (1 revision) (flutter/flutter#147880)
2024-05-06 [email protected] Fix leak in a test. (flutter/flutter#147846)
2024-05-06 [email protected] Roll Flutter Engine from a30ae7729c95 to d0f99b35eac6 (3 revisions) (flutter/flutter#147878)
2024-05-06 [email protected] Roll Packages from f4719ca to 2dfe645 (3 revisions) (flutter/flutter#147866)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
TecHaxter pushed a commit to TecHaxter/flutter_packages that referenced this pull request May 22, 2024
flutter/flutter@04424e1...7920a52

2024-05-07 [email protected] Add tests for callback_shortcuts.0.dart API example. (flutter/flutter#147536)
2024-05-07 [email protected] Improve Android SDK and NDK mistmatch warning message (flutter/flutter#147809)
2024-05-07 [email protected] Add tests for shortcuts.dart API examples. (flutter/flutter#147433)
2024-05-07 [email protected] Added missing tests for ButtonStyle example (flutter/flutter#147457)
2024-05-07 [email protected] Roll Flutter Engine from ece1d686e3ba to 150f694a7816 (1 revision) (flutter/flutter#147912)
2024-05-07 [email protected] DropdownMenu cleanup (flutter/flutter#147860)
2024-05-07 [email protected] Roll Flutter Engine from 80470584e1e1 to ece1d686e3ba (1 revision) (flutter/flutter#147910)
2024-05-07 [email protected] Roll Flutter Engine from b7bfd94af743 to 80470584e1e1 (1 revision) (flutter/flutter#147906)
2024-05-07 [email protected] Roll Flutter Engine from b64e2300bcd0 to b7bfd94af743 (1 revision) (flutter/flutter#147905)
2024-05-07 [email protected] fix MenuItemButton if child is null  (flutter/flutter#147485)
2024-05-07 [email protected] Fix document generation, eliminate template support from snippets tool. (flutter/flutter#147893)
2024-05-07 [email protected] Roll Flutter Engine from 4cb9e02c06ce to b64e2300bcd0 (1 revision) (flutter/flutter#147904)
2024-05-07 [email protected] test focus example 0 (flutter/flutter#147564)
2024-05-07 [email protected] Roll Flutter Engine from 422f92b992c5 to 4cb9e02c06ce (1 revision) (flutter/flutter#147899)
2024-05-06 [email protected] Roll pub packages (flutter/flutter#147896)
2024-05-06 [email protected] Roll Flutter Engine from 463ff7d2d4d5 to 422f92b992c5 (5 revisions) (flutter/flutter#147895)
2024-05-06 [email protected] MultiSelectableSelectionContainerDelegate documentation fixes. (flutter/flutter#147843)
2024-05-06 [email protected] Roll pub packages (flutter/flutter#147891)
2024-05-06 49699333+dependabot[bot]@users.noreply.github.com Bump actions/checkout from 4.1.4 to 4.1.5 (flutter/flutter#147888)
2024-05-06 [email protected] Fix janks and memory leaks in `CupertinoPageTransition` and `CupertinoFullscreenDialogTransition` (flutter/flutter#146999)
2024-05-06 [email protected] Roll Flutter Engine from 960a0c8fecbe to 463ff7d2d4d5 (1 revision) (flutter/flutter#147886)
2024-05-06 [email protected] Roll Flutter Engine from 70cc300f9ad8 to 960a0c8fecbe (1 revision) (flutter/flutter#147884)
2024-05-06 [email protected] [new gallery] Reisze gallery images (flutter/flutter#147882)
2024-05-06 [email protected] Roll Flutter Engine from d0f99b35eac6 to 70cc300f9ad8 (1 revision) (flutter/flutter#147880)
2024-05-06 [email protected] Fix leak in a test. (flutter/flutter#147846)
2024-05-06 [email protected] Roll Flutter Engine from a30ae7729c95 to d0f99b35eac6 (3 revisions) (flutter/flutter#147878)
2024-05-06 [email protected] Roll Packages from f4719ca to 2dfe645 (3 revisions) (flutter/flutter#147866)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 6, 2024
creatorpiyush pushed a commit to creatorpiyush/packages that referenced this pull request Jun 10, 2026
flutter/flutter@04424e1...7920a52

2024-05-07 [email protected] Add tests for callback_shortcuts.0.dart API example. (flutter/flutter#147536)
2024-05-07 [email protected] Improve Android SDK and NDK mistmatch warning message (flutter/flutter#147809)
2024-05-07 [email protected] Add tests for shortcuts.dart API examples. (flutter/flutter#147433)
2024-05-07 [email protected] Added missing tests for ButtonStyle example (flutter/flutter#147457)
2024-05-07 [email protected] Roll Flutter Engine from ece1d686e3ba to 150f694a7816 (1 revision) (flutter/flutter#147912)
2024-05-07 [email protected] DropdownMenu cleanup (flutter/flutter#147860)
2024-05-07 [email protected] Roll Flutter Engine from 80470584e1e1 to ece1d686e3ba (1 revision) (flutter/flutter#147910)
2024-05-07 [email protected] Roll Flutter Engine from b7bfd94af743 to 80470584e1e1 (1 revision) (flutter/flutter#147906)
2024-05-07 [email protected] Roll Flutter Engine from b64e2300bcd0 to b7bfd94af743 (1 revision) (flutter/flutter#147905)
2024-05-07 [email protected] fix MenuItemButton if child is null  (flutter/flutter#147485)
2024-05-07 [email protected] Fix document generation, eliminate template support from snippets tool. (flutter/flutter#147893)
2024-05-07 [email protected] Roll Flutter Engine from 4cb9e02c06ce to b64e2300bcd0 (1 revision) (flutter/flutter#147904)
2024-05-07 [email protected] test focus example 0 (flutter/flutter#147564)
2024-05-07 [email protected] Roll Flutter Engine from 422f92b992c5 to 4cb9e02c06ce (1 revision) (flutter/flutter#147899)
2024-05-06 [email protected] Roll pub packages (flutter/flutter#147896)
2024-05-06 [email protected] Roll Flutter Engine from 463ff7d2d4d5 to 422f92b992c5 (5 revisions) (flutter/flutter#147895)
2024-05-06 [email protected] MultiSelectableSelectionContainerDelegate documentation fixes. (flutter/flutter#147843)
2024-05-06 [email protected] Roll pub packages (flutter/flutter#147891)
2024-05-06 49699333+dependabot[bot]@users.noreply.github.com Bump actions/checkout from 4.1.4 to 4.1.5 (flutter/flutter#147888)
2024-05-06 [email protected] Fix janks and memory leaks in `CupertinoPageTransition` and `CupertinoFullscreenDialogTransition` (flutter/flutter#146999)
2024-05-06 [email protected] Roll Flutter Engine from 960a0c8fecbe to 463ff7d2d4d5 (1 revision) (flutter/flutter#147886)
2024-05-06 [email protected] Roll Flutter Engine from 70cc300f9ad8 to 960a0c8fecbe (1 revision) (flutter/flutter#147884)
2024-05-06 [email protected] [new gallery] Reisze gallery images (flutter/flutter#147882)
2024-05-06 [email protected] Roll Flutter Engine from d0f99b35eac6 to 70cc300f9ad8 (1 revision) (flutter/flutter#147880)
2024-05-06 [email protected] Fix leak in a test. (flutter/flutter#147846)
2024-05-06 [email protected] Roll Flutter Engine from a30ae7729c95 to d0f99b35eac6 (3 revisions) (flutter/flutter#147878)
2024-05-06 [email protected] Roll Packages from f4719ca to 2dfe645 (3 revisions) (flutter/flutter#147866)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
bisor0627 pushed a commit to bisor0627/packages that referenced this pull request Jun 19, 2026
flutter/flutter@04424e1...7920a52

2024-05-07 [email protected] Add tests for callback_shortcuts.0.dart API example. (flutter/flutter#147536)
2024-05-07 [email protected] Improve Android SDK and NDK mistmatch warning message (flutter/flutter#147809)
2024-05-07 [email protected] Add tests for shortcuts.dart API examples. (flutter/flutter#147433)
2024-05-07 [email protected] Added missing tests for ButtonStyle example (flutter/flutter#147457)
2024-05-07 [email protected] Roll Flutter Engine from ece1d686e3ba to 150f694a7816 (1 revision) (flutter/flutter#147912)
2024-05-07 [email protected] DropdownMenu cleanup (flutter/flutter#147860)
2024-05-07 [email protected] Roll Flutter Engine from 80470584e1e1 to ece1d686e3ba (1 revision) (flutter/flutter#147910)
2024-05-07 [email protected] Roll Flutter Engine from b7bfd94af743 to 80470584e1e1 (1 revision) (flutter/flutter#147906)
2024-05-07 [email protected] Roll Flutter Engine from b64e2300bcd0 to b7bfd94af743 (1 revision) (flutter/flutter#147905)
2024-05-07 [email protected] fix MenuItemButton if child is null  (flutter/flutter#147485)
2024-05-07 [email protected] Fix document generation, eliminate template support from snippets tool. (flutter/flutter#147893)
2024-05-07 [email protected] Roll Flutter Engine from 4cb9e02c06ce to b64e2300bcd0 (1 revision) (flutter/flutter#147904)
2024-05-07 [email protected] test focus example 0 (flutter/flutter#147564)
2024-05-07 [email protected] Roll Flutter Engine from 422f92b992c5 to 4cb9e02c06ce (1 revision) (flutter/flutter#147899)
2024-05-06 [email protected] Roll pub packages (flutter/flutter#147896)
2024-05-06 [email protected] Roll Flutter Engine from 463ff7d2d4d5 to 422f92b992c5 (5 revisions) (flutter/flutter#147895)
2024-05-06 [email protected] MultiSelectableSelectionContainerDelegate documentation fixes. (flutter/flutter#147843)
2024-05-06 [email protected] Roll pub packages (flutter/flutter#147891)
2024-05-06 49699333+dependabot[bot]@users.noreply.github.com Bump actions/checkout from 4.1.4 to 4.1.5 (flutter/flutter#147888)
2024-05-06 [email protected] Fix janks and memory leaks in `CupertinoPageTransition` and `CupertinoFullscreenDialogTransition` (flutter/flutter#146999)
2024-05-06 [email protected] Roll Flutter Engine from 960a0c8fecbe to 463ff7d2d4d5 (1 revision) (flutter/flutter#147886)
2024-05-06 [email protected] Roll Flutter Engine from 70cc300f9ad8 to 960a0c8fecbe (1 revision) (flutter/flutter#147884)
2024-05-06 [email protected] [new gallery] Reisze gallery images (flutter/flutter#147882)
2024-05-06 [email protected] Roll Flutter Engine from d0f99b35eac6 to 70cc300f9ad8 (1 revision) (flutter/flutter#147880)
2024-05-06 [email protected] Fix leak in a test. (flutter/flutter#147846)
2024-05-06 [email protected] Roll Flutter Engine from a30ae7729c95 to d0f99b35eac6 (3 revisions) (flutter/flutter#147878)
2024-05-06 [email protected] Roll Packages from 601aa6e to c1041b1 (3 revisions) (flutter/flutter#147866)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants