diff --git a/lib/const/maps.dart b/lib/const/maps.dart index de56b91d..6ad3614f 100644 --- a/lib/const/maps.dart +++ b/lib/const/maps.dart @@ -31,21 +31,21 @@ class VisionGeometryAlignment { class Maps { static List availableMaps = [ MapValue.abyss, - MapValue.ascent, + MapValue.bind, + MapValue.corrode, MapValue.haven, MapValue.lotus, - MapValue.split, MapValue.sunset, MapValue.summit, ]; static List outofplayMaps = [ - MapValue.bind, + MapValue.ascent, MapValue.breeze, - MapValue.corrode, MapValue.fracture, MapValue.icebox, MapValue.pearl, + MapValue.split, ]; /// The map's name as users read it: "Ascent", "Icebox". diff --git a/test/map_pool_test.dart b/test/map_pool_test.dart new file mode 100644 index 00000000..2a0bd033 --- /dev/null +++ b/test/map_pool_test.dart @@ -0,0 +1,13 @@ +import 'package:flutter_test/flutter_test.dart'; +import 'package:icarus/const/maps.dart'; + +void main() { + // Pick a map and the editor's map selector only offer these two lists, so a + // map left out of both during a rotation can't be picked at all. + test('every map is in exactly one of the two lists', () { + expect([ + ...Maps.availableMaps, + ...Maps.outofplayMaps, + ], unorderedEquals(MapValue.values)); + }); +} diff --git a/test/widgets/web_beta_library_test.dart b/test/widgets/web_beta_library_test.dart index d59fdc79..0b1914f8 100644 --- a/test/widgets/web_beta_library_test.dart +++ b/test/widgets/web_beta_library_test.dart @@ -33,6 +33,12 @@ import 'package:toastification/toastification.dart'; /// The library as a user reaches it: the real FolderNavigator, workspace, /// navigation, and create dialogs. Only auth and the Convex repository are /// stand-ins. +/// A tile the dialog shows without opening Out of rotation, whichever maps +/// are in the pool this act. +Finder _tileInThePool() => find.byKey( + ValueKey('create-strategy-map-${Maps.mapNames[Maps.availableMaps.first]}'), + ); + void main() { late Directory tempDir; @@ -160,7 +166,7 @@ void main() { await tester.tap(find.byKey(const ValueKey('library-new-strategy'))); await tester.pumpAndSettle(); - await tester.tap(find.byKey(const ValueKey('create-strategy-map-ascent'))); + await tester.tap(_tileInThePool()); await _settleToasts(tester); expect(app.repository.calls, ['createStrategyWithInitialPage']); @@ -197,7 +203,7 @@ void main() { await tester.pump(); expect(app.workspace, LibraryWorkspace.local); - await tester.tap(find.byKey(const ValueKey('create-strategy-map-ascent'))); + await tester.tap(_tileInThePool()); await tester.pumpAndSettle(); // The local branch refused; the user is told, nothing is saved. expect(find.text("Couldn't create strategy right now."), findsOneWidget); diff --git a/tool/drive/scripts/pick-a-map.json b/tool/drive/scripts/pick-a-map.json new file mode 100644 index 00000000..7b885fe3 --- /dev/null +++ b/tool/drive/scripts/pick-a-map.json @@ -0,0 +1,21 @@ +[ + {"wait": 10}, + {"tapIcon": "x", "optional": true}, + {"tapKey": "library-new-strategy"}, + {"wait": 2}, + {"hoverAt": [800, 120]}, + {"wait": 1}, + {"shot": "{out}/1-pick-a-map.png"}, + {"tapKey": "create-strategy-out-of-rotation"}, + {"hoverAt": [800, 120]}, + {"wait": 1}, + {"shot": "{out}/2-out-of-rotation.png"}, + {"tapKey": "create-strategy-map-corrode"}, + {"wait": 6}, + {"tapIcon": "x", "optional": true}, + {"shot": "{out}/3-opened-on-the-map.png"}, + {"tapAt": [100, 80]}, + {"wait": 2}, + {"shot": "{out}/4-map-selector.png"}, + {"exit": 1} +]