test: move root contract fixture

This commit is contained in:
Peter Steinberger
2026-05-03 12:48:12 +01:00
parent c1b9af2770
commit b8a4d6a58a
5 changed files with 7 additions and 4 deletions

147
test/fixtures/talk-config-contract.json vendored Normal file
View File

@@ -0,0 +1,147 @@
{
"selectionCases": [
{
"id": "canonical_resolved_wins",
"defaultProvider": "elevenlabs",
"payloadValid": true,
"expectedSelection": {
"provider": "elevenlabs",
"normalizedPayload": true,
"voiceId": "voice-normalized",
"apiKey": "xxxxx"
},
"talk": {
"resolved": {
"provider": "elevenlabs",
"config": {
"voiceId": "voice-resolved",
"apiKey": "xxxxx"
}
},
"provider": "elevenlabs",
"providers": {
"elevenlabs": {
"voiceId": "voice-normalized",
"apiKey": "xxxxx"
}
},
"voiceId": "voice-legacy",
"apiKey": "xxxxx"
}
},
{
"id": "normalized_missing_resolved",
"defaultProvider": "elevenlabs",
"payloadValid": true,
"expectedSelection": {
"provider": "elevenlabs",
"normalizedPayload": true,
"voiceId": "voice-normalized"
},
"talk": {
"provider": "elevenlabs",
"providers": {
"elevenlabs": {
"voiceId": "voice-normalized"
}
},
"voiceId": "voice-legacy"
}
},
{
"id": "provider_mismatch_missing_resolved",
"defaultProvider": "elevenlabs",
"payloadValid": false,
"expectedSelection": null,
"talk": {
"provider": "acme",
"providers": {
"elevenlabs": {
"voiceId": "voice-normalized"
}
}
}
},
{
"id": "ambiguous_providers_missing_resolved",
"defaultProvider": "elevenlabs",
"payloadValid": false,
"expectedSelection": null,
"talk": {
"providers": {
"acme": {
"voiceId": "voice-acme"
},
"elevenlabs": {
"voiceId": "voice-normalized"
}
}
}
},
{
"id": "legacy_payload_fallback",
"defaultProvider": "elevenlabs",
"payloadValid": true,
"expectedSelection": {
"provider": "elevenlabs",
"normalizedPayload": true,
"voiceId": "voice-legacy",
"apiKey": "xxxxx"
},
"talk": {
"voiceId": "voice-legacy",
"apiKey": "xxxxx"
}
}
],
"timeoutCases": [
{
"id": "integer_timeout_kept",
"fallback": 700,
"expectedTimeoutMs": 1500,
"talk": {
"silenceTimeoutMs": 1500
}
},
{
"id": "integer_like_double_timeout_kept",
"fallback": 700,
"expectedTimeoutMs": 1500,
"talk": {
"silenceTimeoutMs": 1500.0
}
},
{
"id": "zero_timeout_falls_back",
"fallback": 700,
"expectedTimeoutMs": 700,
"talk": {
"silenceTimeoutMs": 0
}
},
{
"id": "boolean_timeout_falls_back",
"fallback": 700,
"expectedTimeoutMs": 700,
"talk": {
"silenceTimeoutMs": true
}
},
{
"id": "string_timeout_falls_back",
"fallback": 700,
"expectedTimeoutMs": 700,
"talk": {
"silenceTimeoutMs": "1500"
}
},
{
"id": "fractional_timeout_falls_back",
"fallback": 700,
"expectedTimeoutMs": 700,
"talk": {
"silenceTimeoutMs": 1500.5
}
}
]
}

View File

@@ -743,7 +743,10 @@ describe("scripts/changed-lanes", () => {
});
it("routes root test/support changes to the tooling test lane instead of all lanes", () => {
const result = detectChangedLanes(["test/git-hooks-pre-commit.test.ts"]);
const result = detectChangedLanes([
"test/git-hooks-pre-commit.test.ts",
"test-fixtures/legacy-root-fixture.json",
]);
const plan = createChangedCheckPlan(result);
expect(result.lanes).toMatchObject({