widget refresh enhancements
This commit is contained in:
@@ -17,6 +17,47 @@ void main() {
|
||||
);
|
||||
});
|
||||
|
||||
test('widget refresh push identified by source + type', () {
|
||||
expect(
|
||||
classifyPush({'source': 'connect', 'type': 'widget-refresh'}),
|
||||
PushKind.widgetRefresh,
|
||||
);
|
||||
});
|
||||
|
||||
test('widget refresh push with reason still classifies', () {
|
||||
expect(
|
||||
classifyPush({
|
||||
'source': 'connect',
|
||||
'type': 'widget-refresh',
|
||||
'reason': 'morning',
|
||||
}),
|
||||
PushKind.widgetRefresh,
|
||||
);
|
||||
});
|
||||
|
||||
test('connect push with unrelated type stays connect', () {
|
||||
expect(
|
||||
classifyPush({'source': 'connect', 'type': 'newsletter', 'title': 'Hi'}),
|
||||
PushKind.connect,
|
||||
);
|
||||
});
|
||||
|
||||
test('nextcloud fields take precedence over widget-refresh type', () {
|
||||
expect(
|
||||
classifyPush({
|
||||
'subject': 'enc',
|
||||
'signature': 'sig',
|
||||
'source': 'connect',
|
||||
'type': 'widget-refresh',
|
||||
}),
|
||||
PushKind.nextcloud,
|
||||
);
|
||||
});
|
||||
|
||||
test('widget-refresh type without connect source is unknown', () {
|
||||
expect(classifyPush({'type': 'widget-refresh'}), PushKind.unknown);
|
||||
});
|
||||
|
||||
test('subject without signature is not a nextcloud push', () {
|
||||
expect(classifyPush({'subject': 'enc'}), PushKind.unknown);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user