Skip to content

Commit 32a6e80

Browse files
committed
db test: Test updating GlobalSettings
This can be seen as another important aspect of what it means for ensureGlobalSettings to be functioning properly.
1 parent 86be5c4 commit 32a6e80

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/model/database_test.dart

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,17 @@ void main() {
5252
.themeSetting.equals(ThemeSetting.dark);
5353
});
5454

55+
test('GlobalSettings updates work', () async {
56+
check(await database.ensureGlobalSettings())
57+
.themeSetting.isNull();
58+
59+
// As in doUpdateGlobalSettings.
60+
await database.update(database.globalSettings)
61+
.write(GlobalSettingsCompanion(themeSetting: Value(ThemeSetting.dark)));
62+
check(await database.ensureGlobalSettings())
63+
.themeSetting.equals(ThemeSetting.dark);
64+
});
65+
5566
test('create account', () async {
5667
final accountData = AccountsCompanion.insert(
5768
realmUrl: Uri.parse('https://chat.example/'),

0 commit comments

Comments
 (0)