mirror of
https://github.com/jcreek/LivingDexTracker.git
synced 2026-09-14 17:42:17 +00:00
test(pokedex): cover shared dex loading and preview badges
Adds loadSharedPokedex unit tests and a share preview case for every badge, restoring the branch coverage gate. Gives the offline sync BDD poll 30s so a full Living Dex snapshot can finish caching on CI.
This commit is contained in:
@@ -42,6 +42,22 @@ describe('share preview rendering', () => {
|
||||
expect(svg).toContain('42%');
|
||||
});
|
||||
|
||||
it('lists every enabled dex badge and omits an empty description', () => {
|
||||
const svg = buildSharePreviewSvg({
|
||||
...shared,
|
||||
description: '',
|
||||
isShinyDex: true,
|
||||
isOriginDex: true,
|
||||
isFormDex: true,
|
||||
gameScope: 'Scarlet'
|
||||
});
|
||||
for (const badge of ['Living', 'Shiny', 'Origin', 'Form', 'Scarlet']) {
|
||||
expect(svg).toContain(`class="badge">${badge}</text>`);
|
||||
}
|
||||
expect(svg).not.toContain('All Games');
|
||||
expect(svg).not.toContain('class="description"');
|
||||
});
|
||||
|
||||
it('renders a valid 1200 by 630 PNG', async () => {
|
||||
const png = await renderSharePreview(shared);
|
||||
const metadata = await sharp(png).metadata();
|
||||
|
||||
Reference in New Issue
Block a user