feat: Admin Area General Settings and Categories

This commit is contained in:
OpenVelo Agent
2026-07-22 11:45:21 +00:00
parent de527ec6d6
commit f4648a3730
34 changed files with 7349 additions and 62 deletions
@@ -0,0 +1,28 @@
import sharp from 'sharp';
describe('Category icon normalization (sharp 128x128 pipeline)', () => {
it('produces a 128x128 PNG from a larger source', async () => {
const big = await sharp({
create: { width: 500, height: 500, channels: 3, background: { r: 100, g: 50, b: 200 } },
})
.png()
.toBuffer();
const out = await sharp(big).resize(128, 128, { fit: 'cover' }).png().toBuffer();
const meta = await sharp(out).metadata();
expect(meta.width).toBe(128);
expect(meta.height).toBe(128);
expect(meta.format).toBe('png');
});
it('produces a 128x128 PNG even when the source is smaller than 128', async () => {
const tiny = await sharp({
create: { width: 16, height: 16, channels: 3, background: { r: 0, g: 255, b: 0 } },
})
.png()
.toBuffer();
const out = await sharp(tiny).resize(128, 128, { fit: 'cover' }).png().toBuffer();
const meta = await sharp(out).metadata();
expect(meta.width).toBe(128);
expect(meta.height).toBe(128);
});
});