Getting there
This commit is contained in:
parent
ed5a4379db
commit
f300dbd394
43 changed files with 1213 additions and 459 deletions
66
src/config/vibe-presets.test.ts
Normal file
66
src/config/vibe-presets.test.ts
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
import { vibePresets } from './vibe-presets';
|
||||
|
||||
const FINAL_VIBE_NAMES = [
|
||||
'Aurora Mycelium',
|
||||
'Velvet Observatory',
|
||||
'Lichen Signal',
|
||||
'Tidepool Lantern',
|
||||
'Paper Lantern Fog Copy',
|
||||
'Chrome Pollen',
|
||||
];
|
||||
|
||||
describe('vibePresets', () => {
|
||||
it('keeps the classic preset set distinct', () => {
|
||||
expect(vibePresets.map((preset) => preset.name)).toEqual(FINAL_VIBE_NAMES);
|
||||
|
||||
const ids = vibePresets.map((preset) => preset.id);
|
||||
expect(new Set(ids).size).toBe(vibePresets.length);
|
||||
});
|
||||
|
||||
it('includes both blended and visibly particulate styles', () => {
|
||||
const blendedNames = vibePresets
|
||||
.filter(
|
||||
(preset) => preset.settings.brushSize >= 17 && preset.settings.clarity <= 0.56
|
||||
)
|
||||
.map((preset) => preset.name);
|
||||
const softParticleNames = vibePresets
|
||||
.filter(
|
||||
(preset) => preset.settings.brushSize <= 5 && preset.settings.clarity <= 0.2
|
||||
)
|
||||
.map((preset) => preset.name);
|
||||
|
||||
expect(blendedNames).toEqual([
|
||||
'Aurora Mycelium',
|
||||
'Tidepool Lantern',
|
||||
]);
|
||||
expect(softParticleNames).toEqual(['Chrome Pollen']);
|
||||
});
|
||||
|
||||
it('stays inside interactive performance guardrails', () => {
|
||||
const violations = vibePresets.flatMap((preset) => {
|
||||
const { name, settings } = preset;
|
||||
const presetViolations: Array<string> = [];
|
||||
|
||||
if (settings.spawnPerPixel > 0.38) {
|
||||
presetViolations.push(`${name} density exceeds 0.38`);
|
||||
}
|
||||
if (settings.brushSize > 36) {
|
||||
presetViolations.push(`${name} brush size exceeds 36`);
|
||||
}
|
||||
if (
|
||||
settings.spawnPerPixel >= 0.28 &&
|
||||
(settings.decayRateTrails > 940 ||
|
||||
settings.brushSize > 14 ||
|
||||
settings.individualTrailWeight > 0.055)
|
||||
) {
|
||||
presetViolations.push(`${name} combines high density with too much persistence`);
|
||||
}
|
||||
|
||||
return presetViolations;
|
||||
});
|
||||
|
||||
expect(violations).toEqual([]);
|
||||
});
|
||||
});
|
||||
Loading…
Reference in a new issue