Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/thatdeveloperguy-website / tests/unit/scene.test.ts |
| Date | Not specified in source |
| Repository | Janady13/thatdeveloperguy-website |
| Revision | 2bea2ebdff0e34494bff597d4fa9c8422a0c3a94 |
| Branch | main |
| Path or archive member | tests/unit/scene.test.ts |
| Original SHA-256 | 0dc12bf3ed80293da14ef7159ec791ce3aa90090912e39c3050340cce3b0ddd4 |
| Git blob SHA | 6fe7c743ece220205af09591a4c2d86f039b5195 |
| Reading-copy SHA-256 | 0dc12bf3ed80293da14ef7159ec791ce3aa90090912e39c3050340cce3b0ddd4 |
Recovered source transcript
Download complete source text ↓20 lines · 1.4 KB
import { test } from 'node:test';
import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
import { resolveDestination } from '../../app/experience/resolve-destination.ts';
const lobby = JSON.parse(readFileSync(new URL('../../app/experience/scenes/lobby/scene.json', import.meta.url), 'utf8'));
test('lobby hotspots resolve to registry URLs: three doors, reception → contact, lounge → company', () => {
const hrefs = lobby.hotspots.map((h: any) => resolveDestination(h.target, 'home'));
assert.deepEqual(hrefs, ['/capabilities/business-it', '/government', '/capabilities/cybersecurity', '/contact', '/company']);
});
test('room hotspots resolve to anchors and contact intents; a draft page resolves to null', () => {
const it = JSON.parse(readFileSync(new URL('../../app/experience/scenes/it-services/scene.json', import.meta.url), 'utf8'));
assert.equal(resolveDestination(it.hotspots[0].target, 'capability.business-it'), '#overview');
assert.equal(resolveDestination({ kind: 'anchor', anchor: 'overview', pageId: 'capability.business-it' }, 'home'), '/capabilities/business-it#overview');
assert.equal(resolveDestination({ kind: 'page', pageId: 'contact', project: 'itsupport' }, 'capability.business-it'), '/contact?project=itsupport&from=capability.business-it');
assert.equal(resolveDestination({ kind: 'page', pageId: 'audience.business' }, 'home'), null);
});