Skip to content

Commit 9456d44

Browse files
committed
settings test [nfc]: Move tests from store_test; rename
This probably should have happened as part of 1cf31a4 and 9201ae4, oh well.
1 parent 8f5df97 commit 9456d44

File tree

2 files changed

+22
-23
lines changed

2 files changed

+22
-23
lines changed

test/model/settings_test.dart

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,26 @@ void main() {
5151
UrlLaunchMode.externalApplication);
5252
});
5353
});
54+
55+
group('setThemeSetting', () {
56+
test('smoke', () async {
57+
final globalSettings = eg.globalStore().settings;
58+
check(globalSettings).themeSetting.equals(null);
59+
60+
await globalSettings.setThemeSetting(ThemeSetting.dark);
61+
check(globalSettings).themeSetting.equals(ThemeSetting.dark);
62+
});
63+
64+
test('should notify listeners', () async {
65+
int notifyCount = 0;
66+
final globalSettings = eg.globalStore().settings;
67+
globalSettings.addListener(() => notifyCount++);
68+
check(notifyCount).equals(0);
69+
70+
await globalSettings.setThemeSetting(ThemeSetting.light);
71+
check(notifyCount).equals(1);
72+
});
73+
74+
// TODO integration tests with sqlite
75+
});
5476
}

test/model/store_test.dart

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import 'package:zulip/api/route/messages.dart';
1515
import 'package:zulip/api/route/realm.dart';
1616
import 'package:zulip/log.dart';
1717
import 'package:zulip/model/actions.dart';
18-
import 'package:zulip/model/settings.dart';
1918
import 'package:zulip/model/store.dart';
2019
import 'package:zulip/notifications/receive.dart';
2120

@@ -31,28 +30,6 @@ import 'test_store.dart';
3130
void main() {
3231
TestZulipBinding.ensureInitialized();
3332

34-
group('GlobalStore.updateGlobalSettings', () {
35-
test('smoke', () async {
36-
final globalSettings = eg.globalStore().settings;
37-
check(globalSettings).themeSetting.equals(null);
38-
39-
await globalSettings.setThemeSetting(ThemeSetting.dark);
40-
check(globalSettings).themeSetting.equals(ThemeSetting.dark);
41-
});
42-
43-
test('should notify listeners', () async {
44-
int notifyCount = 0;
45-
final globalSettings = eg.globalStore().settings;
46-
globalSettings.addListener(() => notifyCount++);
47-
check(notifyCount).equals(0);
48-
49-
await globalSettings.setThemeSetting(ThemeSetting.light);
50-
check(notifyCount).equals(1);
51-
});
52-
53-
// TODO integration tests with sqlite
54-
});
55-
5633
final account1 = eg.selfAccount.copyWith(id: 1);
5734
final account2 = eg.otherAccount.copyWith(id: 2);
5835

0 commit comments

Comments
 (0)