Skip to content

Commit 9673780

Browse files
committed
Update controller call in animation lifecycle store test
1 parent fcdbe3a commit 9673780

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

‎src/components/scripts/store/__tests__/animationLifecycle.spec.ts‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,22 @@ describe('animation lifecycle store', () => {
129129

130130
const onPlay = vi.fn()
131131
const onPause = vi.fn()
132-
createAnimationController({
132+
const controller = createAnimationController({
133133
animationId: 'computers',
134134
onPlay,
135135
onPause,
136136
})
137137

138-
expect(onPause).toHaveBeenCalledTimes(1)
138+
expect(onPause).not.toHaveBeenCalled()
139139
expect(onPlay).not.toHaveBeenCalled()
140140

141+
controller.requestPlay()
142+
expect(onPlay).toHaveBeenCalledTimes(1)
143+
expect(onPause).not.toHaveBeenCalled()
144+
145+
controller.requestPause()
146+
expect(onPause).toHaveBeenCalledTimes(1)
147+
141148
clearAnimationPreference('computers')
142149
expect(getAnimationPreference('computers')).toBeUndefined()
143150
})

0 commit comments

Comments
 (0)