Files
core2026/app/gateway-api/test/profileSeedCli.test.ts
T

32 lines
1.1 KiB
TypeScript

import { describe, expect, it } from 'vitest';
import { parseProfileSeedRequest } from '../src/orchestrator/profileSeedCli.js';
describe('parseProfileSeedRequest', () => {
it('accepts the serializable selected-workspace seed contract', () => {
expect(
parseProfileSeedRequest({
scenarioId: 1010,
tickSeconds: 60,
now: '2030-01-01T00:00:00.000Z',
installOptions: {
installOperationId: 'operation-id',
installCommitSha: 'abcdef',
preopenAt: null,
},
adminUser: { id: 'admin', username: 'admin' },
})
).toMatchObject({
scenarioId: 1010,
tickSeconds: 60,
installOptions: { installOperationId: 'operation-id', installCommitSha: 'abcdef' },
});
});
it('rejects an invalid timestamp before touching the database', () => {
expect(() => parseProfileSeedRequest({ scenarioId: 1010, now: 'not-a-date' })).toThrow(
'Profile seed now must be an ISO date-time.'
);
});
});