Add guided conflict review flow in Share Inbox

This commit is contained in:
Rijad Zuzo
2026-02-19 01:02:32 +01:00
parent 0347ee1c0a
commit 103ed089fb
5 changed files with 586 additions and 23 deletions
@@ -66,12 +66,68 @@ void main() {
expect(find.text('Share Inbox'), findsOneWidget);
expect(find.text('Ambiguous match'), findsOneWidget);
expect(find.widgetWithText(FilledButton, 'Review & Match'), findsOneWidget);
await tester.tap(find.widgetWithText(TextButton, 'Dismiss Item').first);
await tester.pumpAndSettle();
expect(find.text('No unresolved shares.'), findsOneWidget);
});
testWidgets('opens conflict review dialog and confirms mapping', (
WidgetTester tester,
) async {
final ProviderContainer container = ProviderContainer(
overrides: [
localDataStoreProvider.overrideWithValue(InMemoryLocalDataStore()),
syncStateStoreProvider.overrideWithValue(InMemorySyncStateStore()),
reminderSchedulerProvider.overrideWithValue(_NoopReminderScheduler()),
],
);
addTearDown(container.dispose);
await container.read(localRepositoryProvider.future);
await container
.read(localRepositoryProvider.notifier)
.addPerson(
name: 'Marek Havel',
relationship: 'Friend',
notes: '',
tags: const <String>[],
);
await container
.read(localRepositoryProvider.notifier)
.ingestSharedMessage(
const SharedMessageIngestInput(
sourceApp: 'whatsapp',
sourceDisplayName: 'Marek Havl',
sourceUserId: 'wa:marek_882',
messageText: 'Can you check this event?',
),
);
await tester.pumpWidget(
UncontrolledProviderScope(
container: container,
child: const MaterialApp(home: Scaffold(body: ShareInboxView())),
),
);
await tester.pumpAndSettle();
expect(find.text('Near match conflict'), findsOneWidget);
await tester.tap(find.widgetWithText(FilledButton, 'Review & Match').first);
await tester.pumpAndSettle();
expect(find.text('Review Match'), findsOneWidget);
expect(find.text('Incoming Share'), findsOneWidget);
expect(find.text('Candidate profiles'), findsOneWidget);
await tester.tap(find.widgetWithText(FilledButton, 'Confirm Match'));
await tester.pumpAndSettle();
expect(find.text('No unresolved shares.'), findsOneWidget);
});
}
class _NoopReminderScheduler implements ReminderScheduler {