fuzzyworld

explodorama / files / test / holdRing.test.ts

holdRing.test.ts

Blame: the commit that last changed each line · file · history

92cc4ee3 2026-11-02 Pavel Safronov1import { describe, expect, it } from 'vitest'
2import { ringVisible, type OriginState } from '../src/ui/holdRing'
3
4const up: OriginState = { connected: true, rendered: true, inClosingDialog: false }
5
6describe('ringVisible (Q72: the ring lives only as long as its originator)', () => {
7 it('shows while the picture is there to be seen', () => {
8 expect(ringVisible(up)).toBe(true)
9 })
10 it('hides the moment the picture leaves the page', () => {
11 expect(ringVisible({ ...up, connected: false })).toBe(false)
12 })
13 it('hides when the picture is hidden or has no size', () => {
14 expect(ringVisible({ ...up, rendered: false })).toBe(false)
15 })
16 it('hides while its dialog is closing or closed', () => {
17 expect(ringVisible({ ...up, inClosingDialog: true })).toBe(false)
18 })
19})