Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/const/maps.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,21 @@ class VisionGeometryAlignment {
class Maps {
static List<MapValue> availableMaps = [
MapValue.abyss,
MapValue.ascent,
MapValue.bind,
MapValue.corrode,
MapValue.haven,
MapValue.lotus,
MapValue.split,
MapValue.sunset,
MapValue.summit,
];

static List<MapValue> 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".
Expand Down
13 changes: 13 additions & 0 deletions test/map_pool_test.dart
Original file line number Diff line number Diff line change
@@ -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));
});
}
10 changes: 8 additions & 2 deletions test/widgets/web_beta_library_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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']);

Expand Down Expand Up @@ -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);
Expand Down
21 changes: 21 additions & 0 deletions tool/drive/scripts/pick-a-map.json
Original file line number Diff line number Diff line change
@@ -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}
]
Loading