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' ;
@@ -92,10 +94,12 @@ void main() {
92
94
await tester.tap (find.byType (TextButton ));
93
95
await tester.pumpAndSettle ();
94
96
95
- await expectLater (
96
- find.byType (NutritionalPlanScreen ),
97
- matchesGoldenFile ('goldens/nutritional_plan_1_default_view.png' ),
98
- );
97
+ if (Platform .isLinux) {
98
+ await expectLater (
99
+ find.byType (NutritionalPlanScreen ),
100
+ matchesGoldenFile ('goldens/nutritional_plan_1_default_view.png' ),
101
+ );
102
+ }
99
103
100
104
// Default view shows plan description, info button, and no ingredients
101
105
expect (find.text ('Less fat, more protein' ), findsOneWidget);
@@ -109,10 +113,12 @@ void main() {
109
113
await tester.tap (infoOutlineButtons.first); // 2nd button shows up also, but is off-screen
110
114
await tester.pumpAndSettle ();
111
115
112
- await expectLater (
113
- find.byType (NutritionalPlanScreen ),
114
- matchesGoldenFile ('goldens/nutritional_plan_2_one_meal_with_ingredients.png' ),
115
- );
116
+ if (Platform .isLinux) {
117
+ await expectLater (
118
+ find.byType (NutritionalPlanScreen ),
119
+ matchesGoldenFile ('goldens/nutritional_plan_2_one_meal_with_ingredients.png' ),
120
+ );
121
+ }
116
122
117
123
// Ingredients show up now
118
124
expect (find.text ('100g Water' ), findsOneWidget);
@@ -131,10 +137,13 @@ void main() {
131
137
132
138
await tester.tap (infoOutlineButtons.first);
133
139
await tester.pumpAndSettle ();
134
- await expectLater (
135
- find.byType (MaterialApp ),
136
- matchesGoldenFile ('goldens/nutritional_plan_3_both_meals_with_ingredients.png' ),
137
- );
140
+
141
+ if (Platform .isLinux) {
142
+ await expectLater (
143
+ find.byType (MaterialApp ),
144
+ matchesGoldenFile ('goldens/nutritional_plan_3_both_meals_with_ingredients.png' ),
145
+ );
146
+ }
138
147
139
148
expect (find.byIcon (Icons .info_outline), findsOneWidget);
140
149
expect (find.byIcon (Icons .info), findsNWidgets (2 ));
0 commit comments