Merge remote-tracking branch 'origin/dev' into fix/ui-issues
# Conflicts: # untranslated.json
This commit is contained in:
commit
7c2f481520
52 files changed
+1397
-111
No files matched your search
@@ -0,0 +1,37 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:meshcore_open/models/app_settings.dart';
|
||||
|
||||
void main() {
|
||||
test('channel notification modes round-trip by name', () {
|
||||
final settings = AppSettings(
|
||||
channelNotificationModes: {
|
||||
'a': ChannelNotificationMode.mentionsOnly,
|
||||
'b': ChannelNotificationMode.muted,
|
||||
},
|
||||
);
|
||||
final json = settings.toJson();
|
||||
expect(json['channel_notification_modes'], {
|
||||
'a': 'mentionsOnly',
|
||||
'b': 'muted',
|
||||
});
|
||||
expect(json['muted_channels'], ['b']);
|
||||
expect(
|
||||
AppSettings.fromJson(json).channelNotificationModes,
|
||||
settings.channelNotificationModes,
|
||||
);
|
||||
});
|
||||
|
||||
test('invalid channel notification mode entries are skipped', () {
|
||||
final settings = AppSettings.fromJson({
|
||||
'channel_notification_modes': {
|
||||
'ok': 'muted',
|
||||
'unknown': 'loud',
|
||||
'int': 2,
|
||||
'null': null,
|
||||
},
|
||||
});
|
||||
expect(settings.channelNotificationModes, {
|
||||
'ok': ChannelNotificationMode.muted,
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user