Skip to content

Commit

Permalink
chore: add tests for glow
Browse files Browse the repository at this point in the history
  • Loading branch information
LuciNyan committed Aug 24, 2024
1 parent 787445e commit aaf0e1c
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 14 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
65 changes: 51 additions & 14 deletions packages/pixel-profile/test/theme.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,17 @@ describe('Theme with screen effect', () => {
expect(png).toMatchImageSnapshot()
})

it(
'Render card with blue_chill theme and glow',
{
timeout: 10000
},
async () => {
const png = await renderStats(stats, { theme: 'blue_chill', isFastMode: false, screenEffect: true })
expect(png).toMatchImageSnapshot()
}
)

it('Render card with rainbow theme', async () => {
const png = await renderStats(
{ ...stats, avatarUrl: KITTEN_AVATAR },
Expand All @@ -130,13 +141,19 @@ describe('Theme with screen effect', () => {
expect(png).toMatchImageSnapshot()
})

it('Render card with journey theme and dithering', async () => {
const png = await renderStats(
{ ...stats, avatarUrl: DARK_GREEN_AVATAR },
{ theme: 'journey', pixelateAvatar: false, dithering: true, screenEffect: true }
)
expect(png).toMatchImageSnapshot()
})
it(
'Render card with journey theme and glow',
{
timeout: 10000
},
async () => {
const png = await renderStats(
{ ...stats, avatarUrl: DARK_GREEN_AVATAR },
{ theme: 'journey', pixelateAvatar: false, isFastMode: false, screenEffect: true }
)
expect(png).toMatchImageSnapshot()
}
)

it('Render card with fuji theme', async () => {
const png = await renderStats(
Expand All @@ -146,13 +163,19 @@ describe('Theme with screen effect', () => {
expect(png).toMatchImageSnapshot()

Check failure on line 163 in packages/pixel-profile/test/theme.test.ts

View workflow job for this annotation

GitHub Actions / test

packages/pixel-profile/test/theme.test.ts > Theme with screen effect > Render card with fuji theme

Error: New snapshot was not written. The update flag must be explicitly passed to write a new snapshot. + This is likely because this test is run in a continuous integration (CI) environment in which snapshots are not written by default. ❯ packages/pixel-profile/test/theme.test.ts:163:17
})

it('Render card with fuji theme and dithering', async () => {
const png = await renderStats(
{ ...stats, avatarUrl: LUCI_AVATAR },
{ theme: 'fuji', pixelateAvatar: false, dithering: true, screenEffect: true }
)
expect(png).toMatchImageSnapshot()
})
it(
'Render card with fuji theme and glow',
{
timeout: 10000
},
async () => {
const png = await renderStats(
{ ...stats, avatarUrl: LUCI_AVATAR },
{ theme: 'fuji', pixelateAvatar: false, isFastMode: false, screenEffect: true }
)
expect(png).toMatchImageSnapshot()
}
)

it('Render card with road trip theme', async () => {
const png = await renderStats(
Expand All @@ -161,4 +184,18 @@ describe('Theme with screen effect', () => {
)
expect(png).toMatchImageSnapshot()

Check failure on line 185 in packages/pixel-profile/test/theme.test.ts

View workflow job for this annotation

GitHub Actions / test

packages/pixel-profile/test/theme.test.ts > Theme with screen effect > Render card with road trip theme

Error: New snapshot was not written. The update flag must be explicitly passed to write a new snapshot. + This is likely because this test is run in a continuous integration (CI) environment in which snapshots are not written by default. ❯ packages/pixel-profile/test/theme.test.ts:185:17
})

it(
'Render card with road trip theme and glow',
{
timeout: 10000
},
async () => {
const png = await renderStats(
{ ...stats, avatarUrl: PIXEL_DOG_AVATAR },
{ theme: 'road_trip', pixelateAvatar: false, isFastMode: false, screenEffect: true }
)
expect(png).toMatchImageSnapshot()
}
)
})

0 comments on commit aaf0e1c

Please sign in to comment.