fix: resolve navigation-cache regressions and todo UX

This commit is contained in:
qzl
2026-03-20 16:45:08 +08:00
parent 3f1858d733
commit 55f3805ee9
15 changed files with 160 additions and 105 deletions
@@ -12,7 +12,7 @@ class _MockTodoApi extends Mock implements TodoApi {}
void main() {
test(
'complete todo should optimistically update and invalidate pending list key',
'complete todo should optimistically remove item and invalidate pending list key',
() async {
final api = _MockTodoApi();
final store = HybridCacheStore(
@@ -50,7 +50,7 @@ void main() {
final updated = await store.read<CacheEntry<List<TodoResponse>>>(
TodoRepository.pendingListKey,
);
expect(updated?.value.first.status, 'completed');
expect(updated, isNull);
expect(invalidator.wasInvalidated(TodoRepository.pendingListKey), true);
},
);