mirror of
https://github.com/stablyai/orca.git
synced 2026-09-29 08:03:20 +00:00
test(browser-favicon): verify spinner shown while favicon reloads
Updated test expectations to reflect that the favicon component shows a loading spinner during reload instead of keeping the previous image mounted.
This commit is contained in:
@@ -27,18 +27,20 @@ it('retries a failed icon after a same-origin reload completes', () => {
|
||||
expect(view.container.querySelector('img')).not.toBeNull()
|
||||
})
|
||||
|
||||
it('keeps a working image mounted throughout a reload', () => {
|
||||
it('shows a loading spinner throughout a reload', () => {
|
||||
const view = render(icon())
|
||||
const image = view.container.querySelector('img')
|
||||
view.rerender(icon(true))
|
||||
expect(view.container.querySelector('img')).toBe(image)
|
||||
expect(view.container.querySelector('img')).toBeNull()
|
||||
expect(view.container.firstElementChild?.getAttribute('class')).toContain(
|
||||
'motion-safe:animate-spin'
|
||||
)
|
||||
view.rerender(icon(false))
|
||||
expect(view.container.querySelector('img')).toBe(image)
|
||||
expect(view.container.querySelector('img')?.getAttribute('src')).toBe(faviconUrl)
|
||||
})
|
||||
|
||||
it('retries an image that failed during initial loading when loading finishes', () => {
|
||||
it('shows the favicon when initial loading finishes', () => {
|
||||
const view = render(icon(true))
|
||||
fireEvent.error(view.container.querySelector('img')!)
|
||||
expect(view.container.querySelector('img')).toBeNull()
|
||||
view.rerender(icon(false))
|
||||
expect(view.container.querySelector('img')).not.toBeNull()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user