fix(screenshots): precache asset images so the home logo renders; explain the Plantare name
This commit is contained in:
parent
a3697e6b3e
commit
bb5d09bc6a
8 changed files with 35 additions and 18 deletions
|
|
@ -61,6 +61,15 @@ void main() {
|
|||
addTearDown(tester.view.resetPhysicalSize);
|
||||
addTearDown(tester.view.resetDevicePixelRatio);
|
||||
await tester.pumpAndSettle();
|
||||
// Asset images (e.g. the home logo) decode via real async that the fake
|
||||
// test clock doesn't drive, so they'd paint blank. Precache them for real,
|
||||
// then repaint, so they show up in the golden.
|
||||
await tester.runAsync(() async {
|
||||
for (final element in find.byType(Image).evaluate()) {
|
||||
await precacheImage((element.widget as Image).image, element);
|
||||
}
|
||||
});
|
||||
await tester.pumpAndSettle();
|
||||
await expectLater(
|
||||
find.byType(MaterialApp),
|
||||
matchesGoldenFile('goldens/$dir/$name.png'),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue