Skip to content

Commit

Permalink
added test for Stream definition
Browse files Browse the repository at this point in the history
  • Loading branch information
msuchacz-cll committed Nov 5, 2024
1 parent ca5da82 commit 5f46b58
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/screens/Job/generateJobDefinition.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -691,4 +691,31 @@ config = "<config>"
const output = generateJobDefinition(job)
expect(output.definition).toEqual(expectedOutput)
})

it('generates a valid Stream definition', () => {
const job: JobPayload_Fields = {
id: '1',
type: 'stream',
schemaVersion: 1,
name: 'stream test',
externalJobID: '00000000-0000-0000-0000-0000000000001',
maxTaskDuration: '10s',
spec: {
__typename: 'StreamSpec',
streamID: "1001",
},
observationSource: '',
...otherJobFields,
}

const expectedOutput = `type = "stream"
schemaVersion = 1
name = "stream test"
externalJobID = "00000000-0000-0000-0000-0000000000001"
maxTaskDuration = "10s"
streamID = "1001"
`
const output = generateJobDefinition(job)
expect(output.definition).toEqual(expectedOutput)
})
})

0 comments on commit 5f46b58

Please sign in to comment.