Skip to content

Commit 657428e

Browse files
committed
update: platform linux check for goldens
1 parent 134d8cc commit 657428e

7 files changed

+18
-5
lines changed
-2.89 KB
Loading
-2.66 KB
Loading
867 Bytes
Loading

test/nutrition/nutritional_plan_screen_test.dart

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
* along with this program. If not, see <http://www.gnu.org/licenses/>.
1717
*/
1818

19+
import 'dart:io';
20+
1921
import 'package:drift/native.dart';
2022
import 'package:flutter/material.dart';
2123
import 'package:flutter_test/flutter_test.dart';
@@ -95,8 +97,10 @@ void main() {
9597
await tester.tap(find.byType(TextButton));
9698
await tester.pumpAndSettle();
9799

98-
await expectLater(find.byType(NutritionalPlanScreen),
100+
if(Platform.isLinux) {
101+
await expectLater(find.byType(NutritionalPlanScreen),
99102
matchesGoldenFile('goldens/nutritional_plan_1_default_view.png'));
103+
}
100104

101105
// Default view shows plan description, info button, and no ingredients
102106
expect(find.text('Less fat, more protein'), findsOneWidget);
@@ -111,10 +115,13 @@ void main() {
111115
await tester.tap(infoOutlineButtons
112116
.first); // 2nd button shows up also, but is off-screen
113117
await tester.pumpAndSettle();
114-
await expectLater(
118+
119+
if(Platform.isLinux) {
120+
await expectLater(
115121
find.byType(NutritionalPlanScreen),
116122
matchesGoldenFile(
117123
'goldens/nutritional_plan_2_one_meal_with_ingredients.png'));
124+
}
118125

119126
// Ingredients show up now
120127
expect(find.text('100g Water'), findsOneWidget);
@@ -133,10 +140,12 @@ void main() {
133140

134141
await tester.tap(infoOutlineButtons.first);
135142
await tester.pumpAndSettle();
136-
await expectLater(
137-
find.byType(NutritionalPlanScreen),
143+
if(Platform.isLinux) {
144+
await expectLater(
145+
find.byType(MaterialApp),
138146
matchesGoldenFile(
139147
'goldens/nutritional_plan_3_both_meals_with_ingredients.png'));
148+
}
140149

141150
expect(find.byIcon(Icons.info_outline), findsOneWidget);
142151
expect(find.byIcon(Icons.info), findsNWidgets(2));
-334 Bytes
Loading
-185 KB
Binary file not shown.

test/workout/routine_screen_test.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
* along with this program. If not, see <http://www.gnu.org/licenses/>.
1717
*/
1818

19+
import 'dart:io';
20+
1921
import 'package:drift/native.dart';
2022
import 'package:flutter/material.dart';
2123
import 'package:flutter_test/flutter_test.dart';
@@ -75,8 +77,10 @@ void main() {
7577
await tester.tap(find.byType(TextButton));
7678
await tester.pumpAndSettle();
7779

78-
await expectLater(find.byType(RoutineScreen),
80+
if(Platform.isLinux) {
81+
await expectLater(find.byType(MaterialApp),
7982
matchesGoldenFile('goldens/routine_logs_screen_detail.png'));
83+
}
8084

8185
expect(find.text('3 day workout'), findsOneWidget);
8286

0 commit comments

Comments
 (0)