summaryrefslogtreecommitdiff
path: root/server/test/net
diff options
context:
space:
mode:
Diffstat (limited to 'server/test/net')
-rw-r--r--server/test/net/app_test.dart9
-rw-r--r--server/test/net/ws_test_helpers.dart1
2 files changed, 10 insertions, 0 deletions
diff --git a/server/test/net/app_test.dart b/server/test/net/app_test.dart
index 4a02c15..a37a8e5 100644
--- a/server/test/net/app_test.dart
+++ b/server/test/net/app_test.dart
@@ -42,6 +42,15 @@ void main() {
expect(jsonDecode(body), {'status': 'ok'});
});
+ test('serves the game data JSON at /data/', () async {
+ final body = await httpGet(
+ server.httpUrl.replace(path: '/data/editions/editions.json'),
+ );
+ final decoded = jsonDecode(body) as Map<String, dynamic>;
+ expect(decoded['editions'], isA<List>());
+ expect(decoded['editions'], contains('Jaws of the Lion'));
+ });
+
test('session endpoint mints a session and sets the cookie', () async {
final client = HttpClient();
addTearDown(client.close);
diff --git a/server/test/net/ws_test_helpers.dart b/server/test/net/ws_test_helpers.dart
index cb8af67..1903567 100644
--- a/server/test/net/ws_test_helpers.dart
+++ b/server/test/net/ws_test_helpers.dart
@@ -63,6 +63,7 @@ class TestGameServer {
port: 0,
staticDir: 'nonexistent-static-dir',
gameServer: instance.gameServer,
+ dataDir: dataDir,
);
return instance;
}