Skip to content

Commit

Permalink
coverage for default in generateJobDefinition spec switch
Browse files Browse the repository at this point in the history
  • Loading branch information
msuchacz-cll committed Nov 6, 2024
1 parent ecdb6cc commit 045d923
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions src/screens/Job/generateJobDefinition.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: <any>'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)
})
})

0 comments on commit 045d923

Please sign in to comment.