Skip to content

Commit

Permalink
using flat confetti to make sure scale tests are more stable and repe…
Browse files Browse the repository at this point in the history
…atable
  • Loading branch information
catdad committed Dec 3, 2023
1 parent b7ec1c1 commit b5b796b
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -377,13 +377,16 @@ test('shoots default scaled confetti', async t => {
t.context.buffer = await confettiImage(page, {
colors: ['#0000ff'],
shapes: ['circle'],
particleCount: 10
particleCount: 1,
startVelocity: 0,
gravity: 0,
flat: true
});
t.context.image = await removeOpacity(t.context.buffer);

const pixels = await totalPixels(t.context.image);

t.is(pixels > 100 && pixels < 500, true);
t.is(pixels, 124);
});

test('shoots larger scaled confetti', async t => {
Expand All @@ -393,13 +396,16 @@ test('shoots larger scaled confetti', async t => {
colors: ['#0000ff'],
shapes: ['circle'],
scalar: 10,
particleCount: 10
particleCount: 1,
startVelocity: 0,
gravity: 0,
flat: true
});
t.context.image = await removeOpacity(t.context.buffer);

const pixels = await totalPixels(t.context.image);

t.is(pixels > 2000, true);
t.is(pixels, 11476);
});

test('shoots confetti to the left', async t => {
Expand Down

0 comments on commit b5b796b

Please sign in to comment.