smarter timeline update

This commit is contained in:
Moon.eth
2026-07-29 14:47:57 +09:00
parent cc132ad6b4
commit 110b659213
8 changed files with 449 additions and 12 deletions
+25 -4
View File
@@ -143,10 +143,28 @@ describe('Profile', () => {
it('refreshes only the entry feed without reloading the profile', async () => {
const lookupAccount = vi.fn().mockResolvedValue(account())
const fetchAccountStatuses = vi.fn().mockResolvedValue({
items: [status({ content: '<p>Timeline note</p>' })],
links: {},
})
const fetchAccountStatuses = vi
.fn()
.mockResolvedValueOnce({
items: [
status({
id: 'timeline-note',
content: '<p>Timeline note</p>',
favourites_count: 0,
}),
],
links: {},
})
.mockResolvedValueOnce({
items: [
status({
id: 'timeline-note',
content: '<p>Timeline note</p>',
favourites_count: 5,
}),
],
links: {},
})
const services = testServices({
session: session(),
theme: theme(),
@@ -166,5 +184,8 @@ describe('Profile', () => {
await waitFor(() => expect(fetchAccountStatuses).toHaveBeenCalledTimes(2))
expect(lookupAccount).toHaveBeenCalledOnce()
await waitFor(() =>
expect(view.getByRole('button', { name: 'Kudos (5)' })).toBeInTheDocument(),
)
})
})