Updates getAllGroups test

This commit is contained in:
2025-11-16 19:12:49 +01:00
parent e709edbf7a
commit d3de0fda49

View File

@@ -35,7 +35,7 @@ void main() {
tearDown(() async {
await database.close();
});
group('group tests', () {
test('all groups get fetched correclty', () async {
final testgroup2 = Group(
id: 'gr2',
@@ -62,7 +62,9 @@ void main() {
test('group and group members gets added correctly', () async {
await database.groupDao.addGroup(group: testgroup);
final result = await database.groupDao.getGroupById(groupId: testgroup.id);
final result = await database.groupDao.getGroupById(
groupId: testgroup.id,
);
expect(result.id, testgroup.id);
expect(result.name, testgroup.name);
@@ -98,7 +100,9 @@ void main() {
newName: newGroupName,
);
final result = await database.groupDao.getGroupById(groupId: testgroup.id);
final result = await database.groupDao.getGroupById(
groupId: testgroup.id,
);
expect(result.name, newGroupName);
});
@@ -126,7 +130,9 @@ void main() {
expect(playerAdded, true);
final result = await database.groupDao.getGroupById(groupId: testgroup.id);
final result = await database.groupDao.getGroupById(
groupId: testgroup.id,
);
expect(result.members.length, testgroup.members.length + 1);
final addedPlayer = result.members.firstWhere((p) => p.id == player4.id);
@@ -144,7 +150,9 @@ void main() {
);
expect(removed, true);
final result = await database.groupDao.getGroupById(groupId: testgroup.id);
final result = await database.groupDao.getGroupById(
groupId: testgroup.id,
);
expect(result.members.length, testgroup.members.length - 1);
final playerExists = result.members.any((p) => p.id == playerToRemove.id);
@@ -168,4 +176,5 @@ void main() {
final finalCount = await database.groupDao.getGroupCount();
expect(finalCount, 0);
});
});
}