mirror of
https://git.shipoclu.com/moon/plspace.git
synced 2026-08-13 02:42:30 +00:00
smarter timeline update
This commit is contained in:
@@ -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(),
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user