Skip to content

Commit

Permalink
Merge pull request #2487 from leancodepl/fix-formatting
Browse files Browse the repository at this point in the history
Fix formatting
  • Loading branch information
pdenert authored Jan 13, 2025
2 parents ea1d5ae + 0581190 commit 1490c47
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ class PatrolTester {
///
/// ```dart
///
/// /// This [Widget] will only be found when calling
/// /// This [Widget] will only be found when calling
/// ///await $(Foo).waitUntilVisible(alignment: Alignment.topCenter)
/// class Foo extends StatelessWidget {
/// Foo({Key? key}) : super(key: key);
Expand All @@ -517,12 +517,12 @@ class PatrolTester {
/// }
/// ```
/// As there is an empty [SizedBox] in the center of the [Column],
/// calling ``await $(Foo).waitUntilVisible()`` will fail
/// as the underlying [Finder.hitTestable] will not find any
/// calling ``await $(Foo).waitUntilVisible()`` will fail
/// as the underlying [Finder.hitTestable] will not find any
/// hit-testable widget. Changing the ``alignment`` parameter
/// to ``Alignment.topCenter`` and calling
/// to ``Alignment.topCenter`` and calling
/// ``await $(Foo).waitUntilVisible(alignment: Alignment.topCenter)``
/// will make the test pass as the underlying [Finder.hitTestable]
/// will make the test pass as the underlying [Finder.hitTestable]
/// will find the [Text] widget at the top of the [Column].
/// {@endtemplate}
Future<PatrolFinder> waitUntilVisible(
Expand Down
24 changes: 13 additions & 11 deletions packages/patrol_finders/test/patrol_finder_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -566,20 +566,22 @@ void main() {
expect($('done').visible, true);
});



patrolWidgetTest('waits until widget is only visible at the topCenter alignment', ($) async {
patrolWidgetTest(
'waits until widget is only visible at the topCenter alignment',
($) async {
await $.pumpWidget(
MaterialApp(
home: FutureBuilder(
future: Future<void>.delayed(const Duration(seconds: 3)),
builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.done) {
return const Column(children: [
Text('some text'),
SizedBox(height: 60),
Text('some other text'),
],);
return const Column(
children: [
Text('some text'),
SizedBox(height: 60),
Text('some other text'),
],
);
} else {
return const Text('in progress');
}
Expand All @@ -591,9 +593,9 @@ void main() {
expect($(Column).visible, false);
expect($(Column).isVisibleAt(alignment: Alignment.topCenter), true);
await expectLater(
$(Column).waitUntilVisible,
throwsA(isA<WaitUntilVisibleTimeoutException>()),
);
$(Column).waitUntilVisible,
throwsA(isA<WaitUntilVisibleTimeoutException>()),
);
});
});

Expand Down

0 comments on commit 1490c47

Please sign in to comment.