Skip to content

Commit

Permalink
[chnobli] add test for #7
Browse files Browse the repository at this point in the history
  • Loading branch information
Sören Meier committed Jun 3, 2024
1 parent 7f3e268 commit 8afbe26
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions chnobli/src/tests/properties.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,4 +271,45 @@ describe('properties', () => {
ticker.run();
expect(div.style.width).toBe(undefined);
});

it('restore before', () => {
const ticker = new TestTicker();

const div = el();
const tl = timeline().add(div, {
x: 100,
duration: 10,
});

tl.seek(0.95);

ticker.run();
expect(div.style.transform).toBe(
'translate3d(95.000px,0.000px,0.000px)',
);

const tl2 = timeline().add(div, {
x: 100,
duration: 10,
});
tl2._inner.init();

ticker.run();
expect(div.style.transform).toBe(
'translate3d(95.000px,0.000px,0.000px)',
);

const tl3 = timeline()
.add(
{ opacity: 0 },
{
opacity: 1,
},
)
.play();
ticker.run();
expect(div.style.transform).toBe(

Check failure on line 311 in chnobli/src/tests/properties.test.ts

View workflow job for this annotation

GitHub Actions / test

src/tests/properties.test.ts > properties > restore before

AssertionError: expected '' to be 'translate3d(95.000px,0.000px,0.000px)' // Object.is equality - Expected + Received - translate3d(95.000px,0.000px,0.000px) ❯ src/tests/properties.test.ts:311:31
'translate3d(95.000px,0.000px,0.000px)',
);
});
});

0 comments on commit 8afbe26

Please sign in to comment.