Skip to content

Commit

Permalink
Add a test for 2a7d800
Browse files Browse the repository at this point in the history
  • Loading branch information
chuganzy committed Aug 4, 2023
1 parent 2a7d800 commit 9848052
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { inertia } from "../inertia"
import { pregenerateKeyframes } from "./utils"

describe("inertia", () => {
test("Runs animations with default values ", () => {
test("Runs animations with default values", () => {
const generator = inertia({
keyframes: [0],
})
Expand All @@ -23,6 +23,18 @@ describe("inertia", () => {
expect(keyframes).toEqual(expectedAnimationKeyframes)
})

test("Continues animation when time is 0", () => {
const generator = inertia({
keyframes: [100],
min: 0,
max: 0,
})

const state = generator.next(0)
expect(state.done).toEqual(false)
expect(state.value).toEqual(100)
})

test("modifyTarget changes calculated target", () => {
const generator = inertia({
keyframes: [100],
Expand Down

0 comments on commit 9848052

Please sign in to comment.