-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Add tests for deletable_chip_attributes.on_deleted.0.dart #152361
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 deletable_chip_attributes.on_deleted.0.dart #152361
Conversation
| import 'package:flutter_test/flutter_test.dart'; | ||
|
|
||
| void main() { | ||
| testWidgets('RawChip.deleteIconBoxConstraints updates delete icon size constraints', (WidgetTester tester) async { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test description is from the other DeletableChipAttributes examples. Can you update it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Arf sorry about that :(
I changed it in test: Update description
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@ValentinVignal You made a lot of valuable contributions during the past years, would you be interested in getting contributor access (see https://github.com/flutter/flutter/blob/master/docs/contributing/Contributor-access.md)?
If yes, @TahaTesser and I will be happy to sponsor you.
|
I would love that @bleroux :) That would be awesome! |
|
|
||
| // Delete Alexander Hamilton. | ||
| await tester.tap( | ||
| find.descendant(of: find.widgetWithText(Chip, 'Alexander Hamilton'), matching: find.byIcon(Icons.cancel)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| find.descendant(of: find.widgetWithText(Chip, 'Alexander Hamilton'), matching: find.byIcon(Icons.cancel)), | |
| find.descendant( | |
| of: find.widgetWithText(Chip, 'Alexander Hamilton'), | |
| matching: find.byIcon(Icons.cancel), | |
| ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we also put in a method that returns Finder and reuse in this test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, is refactor: Create utility method to find chip delete button fine with you?
TahaTesser
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with nit
| Finder cancelIconFinder(String chipText) { | ||
| return find.descendant( | ||
| of: find.widgetWithText(Chip, chipText), | ||
| matching: find.byIcon(Icons.cancel), | ||
| ); | ||
| } | ||
|
|
||
| testWidgets('Chip.onDeleted can be used to delete chips', (WidgetTester tester) async { | ||
| await tester.pumpWidget( | ||
| const example.OnDeletedExampleApp(), | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Finder cancelIconFinder(String chipText) { | |
| return find.descendant( | |
| of: find.widgetWithText(Chip, chipText), | |
| matching: find.byIcon(Icons.cancel), | |
| ); | |
| } | |
| testWidgets('Chip.onDeleted can be used to delete chips', (WidgetTester tester) async { | |
| await tester.pumpWidget( | |
| const example.OnDeletedExampleApp(), | |
| ); | |
| testWidgets('Chip.onDeleted can be used to delete chips', (WidgetTester tester) async { | |
| await tester.pumpWidget( | |
| const example.OnDeletedExampleApp(), | |
| ); | |
| Finder cancelIconFinder(String chipText) { | |
| return find.descendant( | |
| of: find.widgetWithText(Chip, chipText), | |
| matching: find.byIcon(Icons.cancel), | |
| ); | |
| } | |
Unless the code is reused in multiple tests, it's better to keep inside the test code for readability and portability.
…-chip-attribute-on-deleted
Manual roll requested by stuartmorgan@google.com flutter/flutter@9d5ede0...85960d2 2024-07-30 leroux_bruno@yahoo.fr Fix Shortcut label for CharacterActivator does not include modifiers (flutter/flutter#152233) 2024-07-30 rexios@rexios.dev [wiki] Remove text saying wiki edits do not get code reviewed (flutter/flutter#152530) 2024-07-30 engine-flutter-autoroll@skia.org Roll Flutter Engine from cb96743cc955 to c58d87d62c20 (1 revision) (flutter/flutter#152527) 2024-07-30 gspencergoog@users.noreply.github.com Add `find.backButton` finder and `StandardComponentType` enum to find components in tests. (flutter/flutter#149349) 2024-07-30 engine-flutter-autoroll@skia.org Roll Flutter Engine from 49324cd0b678 to cb96743cc955 (4 revisions) (flutter/flutter#152524) 2024-07-30 jonahwilliams@google.com [devicelab] remove Skia specific and unused devicelab metrics. (flutter/flutter#152523) 2024-07-30 kalathiyadimil@gmail.com Add Dimil Kalathiya to authors (flutter/flutter#152491) 2024-07-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from 240fb460675d to 49324cd0b678 (4 revisions) (flutter/flutter#152521) 2024-07-29 victorsanniay@gmail.com Stop CupertinoScrollbar's track from paging the scroll view on tap (flutter/flutter#152197) 2024-07-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from 4ef0f0d988ec to 240fb460675d (1 revision) (flutter/flutter#152507) 2024-07-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from a0219f7a429c to 4ef0f0d988ec (1 revision) (flutter/flutter#152505) 2024-07-29 jonahwilliams@google.com [flutter_tools] remove raster stats CLI option. (flutter/flutter#152501) 2024-07-29 zanderso@users.noreply.github.com Shift some mac Android tests to Mokey devices in staging (flutter/flutter#152499) 2024-07-29 jonahwilliams@google.com [devicelab] enable impeller in external texture test. (flutter/flutter#152502) 2024-07-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from d1995f302c4d to a0219f7a429c (2 revisions) (flutter/flutter#152500) 2024-07-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from d803bb16c8b0 to d1995f302c4d (4 revisions) (flutter/flutter#152496) 2024-07-29 36861262+QuncCccccc@users.noreply.github.com Normalize Card theme (flutter/flutter#151914) 2024-07-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from 2db47a1f3d0d to d803bb16c8b0 (1 revision) (flutter/flutter#152489) 2024-07-29 engine-flutter-autoroll@skia.org Roll Packages from 3d358d9 to 247fb5f (8 revisions) (flutter/flutter#152488) 2024-07-29 reidbaker@google.com Update New-Android-version.md (flutter/flutter#152395) 2024-07-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from 510f19a7e629 to 2db47a1f3d0d (1 revision) (flutter/flutter#152485) 2024-07-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from 87cbf33b9028 to 510f19a7e629 (1 revision) (flutter/flutter#152473) 2024-07-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from 2cf3986cae52 to 87cbf33b9028 (2 revisions) (flutter/flutter#152469) 2024-07-29 32538273+ValentinVignal@users.noreply.github.com Add tests for deletable_chip_attributes.on_deleted.0.dart (flutter/flutter#152361) 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 rmistry@google.com,stuartmorgan@google.com 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
…2361) Contributes to flutter#130459 It adds a test for - `examples/api/lib/material/chip/deletable_chip_attributes.on_deleted.0.dart`
…2361) Contributes to flutter#130459 It adds a test for - `examples/api/lib/material/chip/deletable_chip_attributes.on_deleted.0.dart`
Contributes to #130459
It adds a test for
examples/api/lib/material/chip/deletable_chip_attributes.on_deleted.0.dartPre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.