[art-prep] Phase2Pictures: Add the fox, berries, bush, paths and lanterns to the art board, each card marked with its phase
This commit is contained in:
@@ -2,7 +2,7 @@ import { readFileSync, readdirSync } from 'node:fs';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { boardData } from '../src/board.js';
|
||||
import { placeholders } from '../src/placeholders.js';
|
||||
import { readManifest, readStyle, root } from './fixtures.js';
|
||||
import { clone, readManifest, readStyle, root } from './fixtures.js';
|
||||
|
||||
const manifest = readManifest();
|
||||
const data = boardData(manifest, readStyle());
|
||||
@@ -19,7 +19,13 @@ describe('the board data', () => {
|
||||
for (const c of a.cells ?? []) expect(c).toMatchObject({ id: expect.any(String), width: expect.any(Number), height: expect.any(Number), prompt: expect.any(String) });
|
||||
}
|
||||
}
|
||||
expect(data.checklist).toHaveLength(8);
|
||||
expect(data.checklist).toHaveLength(10);
|
||||
expect(data.assets.every((a) => Number.isInteger(a.phase))).toBe(true);
|
||||
});
|
||||
|
||||
it('every card says its phase, so a Phase 3 picture is never mistaken for a Phase 1 one', () => {
|
||||
expect(page).toContain('`Phase ${a.phase} · sprite sheet');
|
||||
expect(page).toContain('`Phase ${a.phase} · ${a.type}');
|
||||
});
|
||||
|
||||
it('every kind in the manifest has a group on the board page, or its cards would never show', () => {
|
||||
@@ -46,6 +52,12 @@ describe('the stand-ins', () => {
|
||||
expect(stand.get('watering-can')).toContain('viewBox="0 0 512 512"');
|
||||
});
|
||||
|
||||
it('a picture with no stand-in drawing stops the build, instead of showing an empty box', () => {
|
||||
const m = clone(manifest);
|
||||
(m.assets.find((a) => a.id === 'lanterns-sheet')?.cells as unknown as { id: string }[])[1]!.id = 'lantern-blue';
|
||||
expect(() => placeholders(m)).toThrow(/no stand-in drawing for "lantern-blue"/);
|
||||
});
|
||||
|
||||
it('load nothing from anywhere', () => {
|
||||
for (const svg of stand.values()) {
|
||||
expect(svg.replace('xmlns="http://www.w3.org/2000/svg"', '')).not.toMatch(/https?:|href=|<image|<script/);
|
||||
|
||||
Reference in New Issue
Block a user