Skip to content

Commit 48e15b2

Browse files
committed
Merge branch 'main' into 546-playwright-refactoring-3
2 parents ed53a5f + 9c1cb0e commit 48e15b2

File tree

6 files changed

+32
-371
lines changed

6 files changed

+32
-371
lines changed

.config/dictionaries/project.dic

+2
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ delegators
7575
devnet
7676
DIND
7777
dockerhub
78+
domcontentloaded
7879
Dominik
7980
dotenv
8081
dotenvy
@@ -189,6 +190,7 @@ netifas
189190
netkey
190191
nextest
191192
Nodetool
193+
NuFi
192194
oapi
193195
OCSP
194196
Oleksandr

catalyst_voices/apps/voices/integration_test/app_test.dart

+9-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import 'package:catalyst_voices/configs/bootstrap.dart';
33
import 'package:catalyst_voices/routes/routes.dart';
44
import 'package:catalyst_voices_models/catalyst_voices_models.dart';
55
import 'package:flutter_test/flutter_test.dart';
6+
import 'package:go_router/go_router.dart';
67
import 'package:integration_test/integration_test.dart';
78
import 'package:patrol_finders/patrol_finders.dart';
89

@@ -11,12 +12,17 @@ import 'pageobject/spaces_drawer_page.dart';
1112

1213
void main() async {
1314
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
15+
late final GoRouter router;
16+
17+
setUpAll(() async {
18+
router = buildAppRouter(initialLocation: const DiscoveryRoute().location);
19+
20+
await bootstrap(router: router);
21+
});
1422

1523
patrolWidgetTest('Spaces drawer guest menu renders correctly',
1624
(PatrolTester $) async {
17-
final args =
18-
await bootstrap(initialLocation: const DiscoveryRoute().location);
19-
await $.pumpWidgetAndSettle(App(routerConfig: args.routerConfig));
25+
await $.pumpWidgetAndSettle(App(routerConfig: router));
2026
await $(DashboardPage.guestShortcutBtn).tap();
2127
await $.pumpAndSettle();
2228
await Future<void>.delayed(const Duration(seconds: 5));

catalyst_voices/apps/voices/lib/configs/bootstrap.dart

+15-7
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,27 @@ Future<void> _doBootstrapAndRun(BootstrapWidgetBuilder builder) async {
7474
await _runApp(app);
7575
}
7676

77+
GoRouter buildAppRouter({
78+
String? initialLocation,
79+
}) {
80+
return AppRouter.init(
81+
initialLocation: initialLocation,
82+
guards: const [
83+
MilestoneGuard(),
84+
],
85+
);
86+
}
87+
7788
/// Initializes the application before it can be run. Should setup all
7889
/// the things which are necessary before the actual app is run,
7990
/// either via [runApp] or injected into a test environment during
8091
/// integration tests.
8192
///
8293
/// Initialization logic that is relevant for [runApp] scenario
8394
/// only should be added to [_doBootstrapAndRun], not here.
84-
Future<BootstrapArgs> bootstrap({String? initialLocation}) async {
95+
Future<BootstrapArgs> bootstrap({
96+
GoRouter? router,
97+
}) async {
8598
_loggingService
8699
..level = kDebugMode ? Level.FINER : Level.OFF
87100
..printLogs = kDebugMode;
@@ -94,12 +107,7 @@ Future<BootstrapArgs> bootstrap({String? initialLocation}) async {
94107
// Key derivation needs to be initialized before it can be used
95108
await CatalystKeyDerivation.init();
96109

97-
final router = AppRouter.init(
98-
initialLocation: initialLocation,
99-
guards: const [
100-
MilestoneGuard(),
101-
],
102-
);
110+
router ??= buildAppRouter();
103111

104112
Bloc.observer = AppBlocObserver();
105113

0 commit comments

Comments
 (0)