Moved getGroupMatches + Tests
All checks were successful
Pull Request Pipeline / test (pull_request) Successful in 39s
Pull Request Pipeline / lint (pull_request) Successful in 44s

This commit is contained in:
2026-03-09 21:27:05 +01:00
parent 4e98dcde41
commit 611033b5cd
5 changed files with 51 additions and 32 deletions

View File

@@ -42,7 +42,7 @@ void main() {
testPlayer4 = Player(name: 'Diana', description: '');
testPlayer5 = Player(name: 'Eve', description: '');
testGroup1 = Group(
name: 'Test Group 2',
name: 'Test Group 1',
description: '',
members: [testPlayer1, testPlayer2, testPlayer3],
);
@@ -351,5 +351,25 @@ void main() {
);
expect(removed, isFalse);
});
test('Fetching all matches related to a group', () async {
var matches = await database.matchDao.getGroupMatches(
groupId: 'non-existing-id',
);
expect(matches, isEmpty);
await database.matchDao.addMatch(match: testMatch1);
print(await database.matchDao.getAllMatches());
matches = await database.matchDao.getGroupMatches(groupId: testGroup1.id);
expect(matches, isNotEmpty);
final match = matches.first;
expect(match.id, testMatch1.id);
expect(match.group, isNotNull);
expect(match.group!.id, testGroup1.id);
});
});
}