test:fix actions errors
Android development APK / apk (push) Failing after 38s
Container images / publish (., deploy/pocketbase/Dockerfile, evoliohealth-pocketbase) (push) Canceled after 0s
Container images / publish (., server/Dockerfile, evoliohealth-server) (push) Canceled after 0s
Checks / flutter (push) Canceled after 0s
Checks / compose (push) Canceled after 0s
Checks / go (push) Canceled after 1m23s
Android development APK / apk (push) Failing after 38s
Container images / publish (., deploy/pocketbase/Dockerfile, evoliohealth-pocketbase) (push) Canceled after 0s
Container images / publish (., server/Dockerfile, evoliohealth-server) (push) Canceled after 0s
Checks / flutter (push) Canceled after 0s
Checks / compose (push) Canceled after 0s
Checks / go (push) Canceled after 1m23s
This commit is contained in:
+12
-5
@@ -1,22 +1,29 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
|
||||
import 'src/biometrics_screen.dart';
|
||||
import 'src/evolio_theme.dart';
|
||||
import 'src/strings.dart';
|
||||
|
||||
void main() {
|
||||
runApp(const EvolioHealthCompanion());
|
||||
}
|
||||
|
||||
class EvolioHealthCompanion extends StatelessWidget {
|
||||
const EvolioHealthCompanion({super.key});
|
||||
const EvolioHealthCompanion({super.key, this.locale});
|
||||
|
||||
final Locale? locale;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
debugShowCheckedModeBanner: false,
|
||||
locale: locale,
|
||||
localizationsDelegates: GlobalMaterialLocalizations.delegates,
|
||||
supportedLocales: const [Locale('en'), Locale('fr')],
|
||||
title: 'EvolioHealth Companion',
|
||||
theme: ThemeData(colorSchemeSeed: const Color(0xFF006C51)),
|
||||
home: const Scaffold(body: Center(child: Text('EvolioHealth Companion'))),
|
||||
supportedLocales: AppStrings.supportedLocales,
|
||||
onGenerateTitle: (context) => AppStrings.of(context).appName,
|
||||
theme: EvolioTheme.dark,
|
||||
home: const BiometricsScreen(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,3 +19,5 @@ dev_dependencies:
|
||||
|
||||
flutter:
|
||||
uses-material-design: true
|
||||
assets:
|
||||
- assets/images/evoliohealth-logo.png
|
||||
|
||||
@@ -1,9 +1,99 @@
|
||||
import 'package:evoliohealth_companion/main.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('renders the product name', (tester) async {
|
||||
await tester.pumpWidget(const EvolioHealthCompanion());
|
||||
expect(find.text('EvolioHealth Companion'), findsOneWidget);
|
||||
testWidgets('renders the EvolioHealth biometrics dashboard in English', (
|
||||
tester,
|
||||
) async {
|
||||
await tester.pumpWidget(const EvolioHealthCompanion(locale: Locale('en')));
|
||||
|
||||
expect(find.bySemanticsLabel('EvolioHealth'), findsOneWidget);
|
||||
expect(
|
||||
find.byWidgetPredicate(
|
||||
(widget) =>
|
||||
widget is Image &&
|
||||
widget.image is AssetImage &&
|
||||
(widget.image as AssetImage).assetName ==
|
||||
'assets/images/evoliohealth-logo.png',
|
||||
),
|
||||
findsOneWidget,
|
||||
);
|
||||
expect(find.text('CURRENT WEIGHT'), findsOneWidget);
|
||||
expect(find.text('CONNECT SCALE'), findsOneWidget);
|
||||
await tester.scrollUntilVisible(
|
||||
find.text('INDICATIVE SILHOUETTE'),
|
||||
250,
|
||||
scrollable: find.byType(Scrollable).first,
|
||||
);
|
||||
expect(
|
||||
find.byWidgetPredicate(
|
||||
(widget) =>
|
||||
widget is Semantics &&
|
||||
widget.properties.label == 'Indicative silhouette',
|
||||
),
|
||||
findsOneWidget,
|
||||
);
|
||||
expect(find.text('Measurements'), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('supports the French interface', (tester) async {
|
||||
await tester.pumpWidget(const EvolioHealthCompanion(locale: Locale('fr')));
|
||||
|
||||
expect(find.text('POIDS ACTUEL'), findsOneWidget);
|
||||
expect(find.text('CONNECTER LA BALANCE'), findsOneWidget);
|
||||
expect(find.text('Mesures'), findsOneWidget);
|
||||
expect(
|
||||
find.textContaining('Visualisation indicative uniquement'),
|
||||
findsOneWidget,
|
||||
);
|
||||
});
|
||||
|
||||
testWidgets('period controls update without replacing the dashboard', (
|
||||
tester,
|
||||
) async {
|
||||
await tester.pumpWidget(const EvolioHealthCompanion(locale: Locale('en')));
|
||||
|
||||
await tester.scrollUntilVisible(
|
||||
find.text('6 mo'),
|
||||
250,
|
||||
scrollable: find.byType(Scrollable).first,
|
||||
);
|
||||
await tester.tap(find.text('6 mo'));
|
||||
await tester.pump();
|
||||
|
||||
expect(find.text('EVOLUTION'), findsOneWidget);
|
||||
expect(find.text('6 mo'), findsOneWidget);
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
|
||||
testWidgets('prototype actions clearly report unavailable persistence', (
|
||||
tester,
|
||||
) async {
|
||||
await tester.pumpWidget(const EvolioHealthCompanion(locale: Locale('en')));
|
||||
|
||||
await tester.tap(find.text('CONNECT SCALE'));
|
||||
await tester.pump();
|
||||
|
||||
expect(
|
||||
find.text('BLE connection will be available in a future step.'),
|
||||
findsOneWidget,
|
||||
);
|
||||
|
||||
await tester.pump(const Duration(seconds: 5));
|
||||
await tester.scrollUntilVisible(
|
||||
find.text('SAVE SESSION'),
|
||||
350,
|
||||
scrollable: find.byType(Scrollable).first,
|
||||
);
|
||||
await tester.drag(find.byType(Scrollable).first, const Offset(0, -180));
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(find.text('SAVE SESSION'));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(
|
||||
find.text('This prototype does not persist measurements yet.'),
|
||||
findsOneWidget,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
+12
-5
@@ -1,22 +1,29 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
|
||||
import 'src/evolio_theme.dart';
|
||||
import 'src/strings.dart';
|
||||
import 'src/web_dashboard.dart';
|
||||
|
||||
void main() {
|
||||
runApp(const EvolioHealthWeb());
|
||||
}
|
||||
|
||||
class EvolioHealthWeb extends StatelessWidget {
|
||||
const EvolioHealthWeb({super.key});
|
||||
const EvolioHealthWeb({super.key, this.locale});
|
||||
|
||||
final Locale? locale;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
debugShowCheckedModeBanner: false,
|
||||
locale: locale,
|
||||
localizationsDelegates: GlobalMaterialLocalizations.delegates,
|
||||
supportedLocales: const [Locale('en'), Locale('fr')],
|
||||
title: 'EvolioHealth',
|
||||
theme: ThemeData(colorSchemeSeed: const Color(0xFF006C51)),
|
||||
home: const Scaffold(body: Center(child: Text('EvolioHealth Server'))),
|
||||
supportedLocales: AppStrings.supportedLocales,
|
||||
onGenerateTitle: (context) => AppStrings.of(context).appName,
|
||||
theme: EvolioTheme.dark,
|
||||
home: const WebDashboard(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,3 +19,6 @@ dev_dependencies:
|
||||
|
||||
flutter:
|
||||
uses-material-design: true
|
||||
assets:
|
||||
- assets/images/evoliohealth-brand.png
|
||||
- assets/images/evoliohealth-logo.png
|
||||
|
||||
+64
-3
@@ -1,9 +1,70 @@
|
||||
import 'package:evoliohealth_web/main.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('renders the product name', (tester) async {
|
||||
await tester.pumpWidget(const EvolioHealthWeb());
|
||||
expect(find.text('EvolioHealth Server'), findsOneWidget);
|
||||
testWidgets('renders the responsive desktop measurements dashboard', (
|
||||
tester,
|
||||
) async {
|
||||
tester.view.physicalSize = const Size(1440, 1000);
|
||||
tester.view.devicePixelRatio = 1;
|
||||
addTearDown(tester.view.resetPhysicalSize);
|
||||
addTearDown(tester.view.resetDevicePixelRatio);
|
||||
|
||||
await tester.pumpWidget(const EvolioHealthWeb(locale: Locale('en')));
|
||||
|
||||
expect(find.byKey(const Key('desktop-navigation')), findsOneWidget);
|
||||
expect(find.text('Hello, Alex'), findsOneWidget);
|
||||
expect(find.text('CURRENT WEIGHT'), findsOneWidget);
|
||||
expect(find.text('INDICATIVE SILHOUETTE'), findsOneWidget);
|
||||
expect(find.text('WEIGHT EVOLUTION'), findsOneWidget);
|
||||
expect(find.text('New session'.toUpperCase()), findsOneWidget);
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
|
||||
testWidgets('keeps the French interface available', (tester) async {
|
||||
tester.view.physicalSize = const Size(1200, 900);
|
||||
tester.view.devicePixelRatio = 1;
|
||||
addTearDown(tester.view.resetPhysicalSize);
|
||||
addTearDown(tester.view.resetDevicePixelRatio);
|
||||
|
||||
await tester.pumpWidget(const EvolioHealthWeb(locale: Locale('fr')));
|
||||
|
||||
expect(find.text('Bonjour, Alex'), findsOneWidget);
|
||||
expect(find.text('POIDS ACTUEL'), findsOneWidget);
|
||||
expect(find.text('SILHOUETTE INDICATIVE'), findsOneWidget);
|
||||
expect(find.text('NOUVELLE SESSION'), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('uses mobile navigation on narrow browser windows', (
|
||||
tester,
|
||||
) async {
|
||||
tester.view.physicalSize = const Size(430, 900);
|
||||
tester.view.devicePixelRatio = 1;
|
||||
addTearDown(tester.view.resetPhysicalSize);
|
||||
addTearDown(tester.view.resetDevicePixelRatio);
|
||||
|
||||
await tester.pumpWidget(const EvolioHealthWeb(locale: Locale('en')));
|
||||
|
||||
expect(find.byKey(const Key('desktop-navigation')), findsNothing);
|
||||
expect(find.byType(NavigationBar), findsOneWidget);
|
||||
expect(find.bySemanticsLabel('EvolioHealth'), findsOneWidget);
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
|
||||
testWidgets('prototype actions do not imply persisted data', (tester) async {
|
||||
tester.view.physicalSize = const Size(1200, 900);
|
||||
tester.view.devicePixelRatio = 1;
|
||||
addTearDown(tester.view.resetPhysicalSize);
|
||||
addTearDown(tester.view.resetDevicePixelRatio);
|
||||
|
||||
await tester.pumpWidget(const EvolioHealthWeb(locale: Locale('en')));
|
||||
await tester.tap(find.text('NEW SESSION'));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(
|
||||
find.text('This prototype is not connected to the EvolioHealth API yet.'),
|
||||
findsOneWidget,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
+2
-1
@@ -6,11 +6,12 @@
|
||||
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
|
||||
<meta name="description" content="Private, self-hosted health tracking.">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="theme-color" content="#101315">
|
||||
<title>EvolioHealth</title>
|
||||
<link rel="icon" type="image/png" href="icons/Icon-256.png">
|
||||
<link rel="manifest" href="manifest.json">
|
||||
</head>
|
||||
<body>
|
||||
<script src="flutter_bootstrap.js" async></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
+14
-5
@@ -3,11 +3,20 @@
|
||||
"short_name": "EvolioHealth",
|
||||
"start_url": ".",
|
||||
"display": "standalone",
|
||||
"background_color": "#ffffff",
|
||||
"theme_color": "#006c51",
|
||||
"background_color": "#101315",
|
||||
"theme_color": "#51e5dc",
|
||||
"description": "Private, self-hosted health tracking.",
|
||||
"orientation": "portrait-primary",
|
||||
"prefer_related_applications": false,
|
||||
"icons": []
|
||||
"icons": [
|
||||
{
|
||||
"src": "icons/Icon-256.png",
|
||||
"sizes": "256x256",
|
||||
"type": "image/png"
|
||||
},
|
||||
{
|
||||
"src": "icons/Icon-512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user