Restructuration majeure du projet: migration de flutt vers app, ajout de l'API et mise à jour du site web
This commit is contained in:
34
app/test/api_environment_test.dart
Normal file
34
app/test/api_environment_test.dart
Normal file
@@ -0,0 +1,34 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:geosector_app/core/constants/app_keys.dart';
|
||||
|
||||
void main() {
|
||||
group('Environment Configuration Tests', () {
|
||||
test('API URLs are correctly configured', () {
|
||||
// Vérifier que les URLs sont différentes pour chaque environnement
|
||||
expect(AppKeys.baseApiUrlDev, 'https://dapp.geosector.fr/api/geo');
|
||||
expect(AppKeys.baseApiUrlRec, 'https://rapp.geosector.fr/api/geo');
|
||||
expect(AppKeys.baseApiUrlProd, 'https://app.geosector.fr/api/geo');
|
||||
|
||||
// Vérifier qu'elles sont différentes les unes des autres
|
||||
expect(AppKeys.baseApiUrlDev != AppKeys.baseApiUrlProd, true);
|
||||
expect(AppKeys.baseApiUrlRec != AppKeys.baseApiUrlProd, true);
|
||||
expect(AppKeys.baseApiUrlDev != AppKeys.baseApiUrlRec, true);
|
||||
});
|
||||
|
||||
test('App Identifiers are correctly configured', () {
|
||||
// Vérifier que les identifiants sont configurés correctement
|
||||
expect(AppKeys.appIdentifierDev, 'dapp.geosector.fr');
|
||||
expect(AppKeys.appIdentifierRec, 'rapp.geosector.fr');
|
||||
expect(AppKeys.appIdentifierProd, 'app.geosector.fr');
|
||||
|
||||
// Vérifier qu'ils sont différents les uns des autres
|
||||
expect(AppKeys.appIdentifierDev != AppKeys.appIdentifierProd, true);
|
||||
expect(AppKeys.appIdentifierRec != AppKeys.appIdentifierProd, true);
|
||||
expect(AppKeys.appIdentifierDev != AppKeys.appIdentifierRec, true);
|
||||
});
|
||||
|
||||
// Note: Les tests de détection d'environnement seraient plus difficiles
|
||||
// à implémenter dans un environnement de test car cela nécessiterait de
|
||||
// mocker l'objet window.location.href qui est dans universal_html
|
||||
});
|
||||
}
|
||||
30
app/test/widget_test.dart
Normal file
30
app/test/widget_test.dart
Normal file
@@ -0,0 +1,30 @@
|
||||
// This is a basic Flutter widget test.
|
||||
//
|
||||
// To perform an interaction with a widget in your test, use the WidgetTester
|
||||
// utility in the flutter_test package. For example, you can send tap and scroll
|
||||
// gestures. You can also use WidgetTester to find child widgets in the widget
|
||||
// tree, read text, and verify that the values of widget properties are correct.
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
import 'package:geosector_app/app.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
|
||||
// Build our app and trigger a frame.
|
||||
await tester.pumpWidget(const GeoSectorApp());
|
||||
|
||||
// Verify that our counter starts at 0.
|
||||
expect(find.text('0'), findsOneWidget);
|
||||
expect(find.text('1'), findsNothing);
|
||||
|
||||
// Tap the '+' icon and trigger a frame.
|
||||
await tester.tap(find.byIcon(Icons.add));
|
||||
await tester.pump();
|
||||
|
||||
// Verify that our counter has incremented.
|
||||
expect(find.text('0'), findsNothing);
|
||||
expect(find.text('1'), findsOneWidget);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user