Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions apps/web/src/features/home/sculptures/marks.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { test } from 'node:test'
import type { Vec3 } from './geometry'
import * as marks from './marks'

const factories = { ...marks }

const expected = [
'claudeMark',
'openaiMark',
Expand All @@ -24,10 +26,10 @@ test('the brand registry contains only the ten requested AI mark factories', ()

for (const id of expected) {
test(`${id}: bounded 3D samples are repeatable and need no browser or network`, () => {
const model = marks[id]()
const model = factories[id]()
assert.ok(model.points.length >= 1000)
assert.ok(model.points.length <= 20000)
assert.deepEqual(model.points, marks[id]().points)
assert.deepEqual(model.points, factories[id]().points)
let front = 0
let back = 0
for (const p of model.points) {
Expand All @@ -42,7 +44,7 @@ for (const id of expected) {
})

test(`${id}: object motion preserves the cached geometry`, () => {
const model = marks[id]()
const model = factories[id]()
const before = model.points.map((p) => [p.x, p.y, p.z, ...p.color])
const initial = model.animate(0)
let moved = 0
Expand All @@ -66,7 +68,7 @@ for (const id of expected) {
})

test(`${id}: all sampled animation frames fit phone and desktop viewports`, () => {
const model = marks[id]()
const model = factories[id]()
const [yaw, pitch] = model.view ?? [0, 0]
for (const [width, height] of [
[320, 400],
Expand Down