Replace the sample data with synthetic fixtures and regenerate goldens and thumbnails
The template harness, tests and thumbnails now use a neutral vendor, bank account and a generated sample wordmark (scripts/logo/make-sample-logo.mjs). Layout goldens and the 14 picker thumbnails are regenerated. Fixture strings keep their original lengths where layout tests depend on them.
This commit is contained in:
@@ -15,7 +15,7 @@ const logo = (over: Partial<SlotLogoInput>): SlotLogoInput => ({
|
||||
hasKnockout: true,
|
||||
...over,
|
||||
});
|
||||
const Sample_P = logo({ aspect: 4.62, density: 0.437, kind: "wordmark", includesName: true });
|
||||
const SAMPLE_LOGO = logo({ aspect: 4.62, density: 0.437, kind: "wordmark", includesName: true });
|
||||
|
||||
/** The box a logo is fitted to: the allowance for a text-only slot, else the lockup (or mark) box. */
|
||||
const lockupTarget = (s: TemplateSlot): Box => (s.textOnly ? s.allowance : s.lockup!);
|
||||
@@ -98,9 +98,9 @@ describe("computeLogoPlacement identity: the placeholder itself comes back as it
|
||||
});
|
||||
|
||||
describe("computeLogoPlacement text-only allowances", () => {
|
||||
it("Test Vendor in Monolith is 28 pt tall, about 129 wide, and keeps the right edge", () => {
|
||||
it("The sample logo in Monolith is 28 pt tall, about 129 wide, and keeps the right edge", () => {
|
||||
const s = SLOTS.monolith!;
|
||||
const p = computeLogoPlacement({ logo: Sample_P, slot: s });
|
||||
const p = computeLogoPlacement({ logo: SAMPLE_LOGO, slot: s });
|
||||
expect(p.h).toBeCloseTo(28, 6);
|
||||
expect(p.w).toBeGreaterThanOrEqual(128);
|
||||
expect(p.w).toBeLessThanOrEqual(130);
|
||||
@@ -117,9 +117,9 @@ describe("computeLogoPlacement text-only allowances", () => {
|
||||
expect(p.x + p.w).toBeCloseTo(560, 6);
|
||||
});
|
||||
|
||||
it("Test Vendor in Tangerine fills 36 pt of height (about 166 wide) at the left edge", () => {
|
||||
it("The sample logo in Tangerine fills 36 pt of height (about 166 wide) at the left edge", () => {
|
||||
const s = SLOTS["tangerine-ledger"]!;
|
||||
const p = computeLogoPlacement({ logo: Sample_P, slot: s });
|
||||
const p = computeLogoPlacement({ logo: SAMPLE_LOGO, slot: s });
|
||||
expect(p.h).toBeCloseTo(36, 6);
|
||||
expect(p.w).toBeCloseTo(36 * 4.62, 6);
|
||||
expect(p.x).toBeCloseTo(60.5, 6);
|
||||
@@ -142,13 +142,13 @@ describe("computeLogoPlacement text-only allowances", () => {
|
||||
describe("computeLogoPlacement on every slot", () => {
|
||||
const all: [TemplateId, TemplateSlot][] = [...measured, ...optIn];
|
||||
|
||||
it("Test Vendor never exceeds its box and is never heavier than the placeholder ink", () => {
|
||||
it("The sample logo never exceeds its box and is never heavier than the placeholder ink", () => {
|
||||
for (const [id, s] of all) {
|
||||
const p = computeLogoPlacement({ logo: Sample_P, slot: s });
|
||||
const p = computeLogoPlacement({ logo: SAMPLE_LOGO, slot: s });
|
||||
expect(p.slotKind).toBe("lockup");
|
||||
expect(inside(p.box, lockupTarget(s)), id).toBe(true);
|
||||
if (!s.optIn && !s.textOnly) {
|
||||
const ink = p.w * p.h * Sample_P.density;
|
||||
const ink = p.w * p.h * SAMPLE_LOGO.density;
|
||||
const placeholderInk = s.lockup!.w * s.lockup!.h * s.lockupDensity;
|
||||
expect(ink, `${id}: ${ink.toFixed(1)} vs ${placeholderInk.toFixed(1)}`).toBeLessThanOrEqual(placeholderInk * 1.05);
|
||||
}
|
||||
@@ -265,7 +265,7 @@ describe("computeLogoPlacement page scale and available room", () => {
|
||||
|
||||
it("shrinks to the room the layout has", () => {
|
||||
const s = SLOTS["teal-swoosh"]!;
|
||||
const p = computeLogoPlacement({ logo: Sample_P, slot: s, available: { w: 80, h: 100 } });
|
||||
const p = computeLogoPlacement({ logo: SAMPLE_LOGO, slot: s, available: { w: 80, h: 100 } });
|
||||
expect(p.w).toBeLessThanOrEqual(80 + 1e-9);
|
||||
expect(p.x).toBeCloseTo(s.lockup!.x, 6);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user