forked from Betterment/alchemist
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Dialog and dropdown are no longer visible on the golden files (B…
- Loading branch information
1 parent
5117adc
commit e53fedd
Showing
6 changed files
with
65 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import 'package:alchemist/src/golden_test.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
|
||
class TestDropdownButton extends StatelessWidget { | ||
const TestDropdownButton({Key? key}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) => Center( | ||
child: DropdownButton<String>( | ||
value: '0', | ||
items: const [ | ||
DropdownMenuItem<String>( | ||
value: '0', | ||
child: Text('0'), | ||
), | ||
DropdownMenuItem<String>( | ||
value: '1', | ||
child: Text('1'), | ||
), | ||
DropdownMenuItem<String>( | ||
value: '2', | ||
child: Text('2'), | ||
), | ||
], | ||
onChanged: (_) {}, | ||
), | ||
); | ||
} | ||
|
||
void main() { | ||
group('smoke test', () { | ||
goldenTest( | ||
'succeeds after tapping dropdown', | ||
fileName: 'dropdown_smoke_test', | ||
constraints: const BoxConstraints( | ||
maxWidth: 200, | ||
maxHeight: 250, | ||
), | ||
pumpBeforeTest: (tester) async { | ||
await tester.pumpAndSettle(); | ||
await tester.tap(find.byType(DropdownButton<String>)); | ||
await tester.pumpAndSettle(); | ||
}, | ||
builder: () { | ||
return const TestDropdownButton(); | ||
}, | ||
); | ||
}); | ||
} |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters