diff --git a/src/screens/Job/generateJobDefinition.test.ts b/src/screens/Job/generateJobDefinition.test.ts index 90aa7db..7d21497 100644 --- a/src/screens/Job/generateJobDefinition.test.ts +++ b/src/screens/Job/generateJobDefinition.test.ts @@ -718,4 +718,47 @@ streamID = "1001" const output = generateJobDefinition(job) expect(output.definition).toEqual(expectedOutput) }) + + it('generates an empty definition for unspecified type', () => { + const job: JobPayload_Fields = { + id: '', + name: '', + externalJobID: '', + observationSource: '', + createdAt: undefined, + schemaVersion: 0, + type: '', + maxTaskDuration: '', + spec: { + __typename: 'Undefined', + coordinatorV1Address: undefined, + coordinatorV2Address: undefined, + waitBlocks: 0, + lookbackBlocks: 0, + blockhashStoreAddress: '', + batchBlockhashStoreAddress: '', + pollPeriod: '', + runTimeout: '', + evmChainID: undefined, + fromAddresses: undefined, + getBlockhashesBatchSize: 0, + storeBlockhashesBatchSize: 0, + coordinatorV2PlusAddress: undefined + }, + runs: { + __typename: undefined, + results: [], + metadata: { + __typename: undefined, + total: 0 + } + }, + errors: [] + } + + const expectedOutput = `` + + const output = generateJobDefinition(job) + expect(output.definition).toEqual(expectedOutput) + }) })