16
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
17
*/
18
18
19
+ import 'dart:io' ;
20
+
19
21
import 'package:drift/native.dart' ;
20
22
import 'package:flutter/material.dart' ;
21
23
import 'package:flutter_test/flutter_test.dart' ;
@@ -95,8 +97,10 @@ void main() {
95
97
await tester.tap (find.byType (TextButton ));
96
98
await tester.pumpAndSettle ();
97
99
98
- await expectLater (find.byType (NutritionalPlanScreen ),
100
+ if (Platform .isLinux) {
101
+ await expectLater (find.byType (NutritionalPlanScreen ),
99
102
matchesGoldenFile ('goldens/nutritional_plan_1_default_view.png' ));
103
+ }
100
104
101
105
// Default view shows plan description, info button, and no ingredients
102
106
expect (find.text ('Less fat, more protein' ), findsOneWidget);
@@ -111,10 +115,13 @@ void main() {
111
115
await tester.tap (infoOutlineButtons
112
116
.first); // 2nd button shows up also, but is off-screen
113
117
await tester.pumpAndSettle ();
114
- await expectLater (
118
+
119
+ if (Platform .isLinux) {
120
+ await expectLater (
115
121
find.byType (NutritionalPlanScreen ),
116
122
matchesGoldenFile (
117
123
'goldens/nutritional_plan_2_one_meal_with_ingredients.png' ));
124
+ }
118
125
119
126
// Ingredients show up now
120
127
expect (find.text ('100g Water' ), findsOneWidget);
@@ -133,10 +140,12 @@ void main() {
133
140
134
141
await tester.tap (infoOutlineButtons.first);
135
142
await tester.pumpAndSettle ();
136
- await expectLater (
137
- find.byType (NutritionalPlanScreen ),
143
+ if (Platform .isLinux) {
144
+ await expectLater (
145
+ find.byType (MaterialApp ),
138
146
matchesGoldenFile (
139
147
'goldens/nutritional_plan_3_both_meals_with_ingredients.png' ));
148
+ }
140
149
141
150
expect (find.byIcon (Icons .info_outline), findsOneWidget);
142
151
expect (find.byIcon (Icons .info), findsNWidgets (2 ));
0 commit comments