widget refresh enhancements

This commit is contained in:
2026-08-06 20:22:32 +02:00
parent 646e2c0451
commit ab23422a86
22 changed files with 1027 additions and 99 deletions
+41
View File
@@ -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);
});