Add LLM digest setup and share timestamp context
This commit is contained in:
@@ -39,6 +39,33 @@ void main() {
|
||||
expect(payload.rawText, 'loves cozy Italian restaurants');
|
||||
});
|
||||
|
||||
test('stores source message datetime when WhatsApp text includes one', () {
|
||||
final SharedPayload payload = SharePayloadParser.parse(
|
||||
rawText: '[19/05/2026, 14:30] Ava Hart: ginger tea helped',
|
||||
sourceApp: 'whatsapp',
|
||||
platform: 'ios',
|
||||
);
|
||||
|
||||
expect(payload.sourceDisplayName, 'Ava Hart');
|
||||
expect(payload.rawText, 'ginger tea helped');
|
||||
expect(payload.sharedMessageDateTime, DateTime(2026, 5, 19, 14, 30));
|
||||
expect(payload.parsingHints, contains('shared_message_datetime_detected'));
|
||||
expect(payload.metadata, contains('shared_message_datetime'));
|
||||
});
|
||||
|
||||
test(
|
||||
'does not store source message datetime for arbitrary content dates',
|
||||
() {
|
||||
final SharedPayload payload = SharePayloadParser.parse(
|
||||
rawText: 'Ava birthday is on May 20 and she likes ginger tea.',
|
||||
sourceApp: 'share_sheet',
|
||||
platform: 'ios',
|
||||
);
|
||||
|
||||
expect(payload.sharedMessageDateTime, isNull);
|
||||
},
|
||||
);
|
||||
|
||||
test('uses explicit signal source app hint and extracts sender', () {
|
||||
final SharedPayload payload = SharePayloadParser.parse(
|
||||
rawText: 'Marek: this concert looks promising',
|
||||
|
||||
Reference in New Issue
Block a user