From fe9239ee02138fdf0751c069a928b1b41e61700d Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Fri, 21 Nov 2025 12:45:48 +0100 Subject: [PATCH] Added missing test --- test/db_tests/group_game_test.dart | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/test/db_tests/group_game_test.dart b/test/db_tests/group_game_test.dart index 2e208d9..6621d9a 100644 --- a/test/db_tests/group_game_test.dart +++ b/test/db_tests/group_game_test.dart @@ -104,7 +104,25 @@ void main() { expect(result.group, null); }); - // TODO: test getGroupOfGame() - test('Retrieving group of a game works correctly', () async {}); + test('Retrieving group of a game works correctly', () async { + await database.gameDao.addGame(game: gameWithGroup); + final group = await database.groupGameDao.getGroupOfGame( + gameId: gameWithGroup.id, + ); + + if (group == null) { + fail('Group should not be null'); + } + + expect(group.id, testgroup.id); + expect(group.name, testgroup.name); + expect(group.createdAt, testgroup.createdAt); + expect(group.members.length, testgroup.members.length); + for (int i = 0; i < group.members.length; i++) { + expect(group.members[i].id, testgroup.members[i].id); + expect(group.members[i].name, testgroup.members[i].name); + expect(group.members[i].createdAt, testgroup.members[i].createdAt); + } + }); }); }