Skip to content

Commit

Permalink
update openapi tests for new config methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Rogers committed Jul 9, 2024
1 parent c6326e4 commit 978a09f
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 2 deletions.
28 changes: 27 additions & 1 deletion packages/openapi/src/__tests__/showstyles.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
// eslint-disable-next-line node/no-missing-import
import { Configuration, ShowStyleBase, ShowstylesApi, ShowStyleVariant } from '../../client/ts'
import {
Configuration,
GetShowStyleConfig200ResponseResult,
ShowStyleBase,
ShowstylesApi,
ShowStyleVariant,
} from '../../client/ts'
import { checkServer } from '../checkServer'
import Logging from '../httpLogging'

Expand Down Expand Up @@ -72,6 +78,26 @@ describe('Network client', () => {
expect(showStyle.status).toBe(200)
})

let showStyleConfig: GetShowStyleConfig200ResponseResult | undefined
test('can request a ShowStyle config by id', async () => {
const showStyle = await showStylesApi.getShowStyleConfig({
showStyleBaseId: showStyleBaseIds[0],
})
expect(showStyle.status).toBe(200)
expect(showStyle).toHaveProperty('result')
expect(showStyle.result).toHaveProperty('developerMode')
showStyleConfig = JSON.parse(JSON.stringify(showStyle.result))
})

test('can update a ShowStyle config', async () => {
showStyleConfig.developerMode = !showStyleConfig.developerMode
const showStyle = await showStylesApi.updateShowStyleConfig({
showStyleBaseId: showStyleBaseIds[0],
requestBody: showStyleConfig,
})
expect(showStyle.status).toBe(200)
})

const showStyleVariantIds: string[] = []
test('can request all ShowStyleVariants', async () => {
const showStyleVariants = await showStylesApi.getShowStyleVariants({
Expand Down
22 changes: 21 additions & 1 deletion packages/openapi/src/__tests__/studios.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// eslint-disable-next-line node/no-missing-import
import { Configuration, Studio, StudiosApi } from '../../client/ts'
import { Configuration, GetStudioConfig200ResponseResult, Studio, StudiosApi } from '../../client/ts'
import { checkServer } from '../checkServer'
import Logging from '../httpLogging'

Expand Down Expand Up @@ -58,6 +58,26 @@ describe('Network client', () => {
expect(studio.status).toBe(200)
})

let studioConfig: GetStudioConfig200ResponseResult | undefined
test('can request a Studio config by id', async () => {
const studio = await studiosApi.getStudioConfig({
studioId: studioIds[0],
})
expect(studio.status).toBe(200)
expect(studio).toHaveProperty('result')
expect(studio.result).toHaveProperty('developerMode')
studioConfig = JSON.parse(JSON.stringify(studio.result))
})

test('can update a studio config', async () => {
studioConfig.developerMode = !studioConfig.developerMode
const studio = await studiosApi.updateStudioConfig({
studioId: studioIds[0],
requestBody: studioConfig,
})
expect(studio.status).toBe(200)
})

const studioDevices: string[] = []
test('can request a list of devices for a studio', async () => {
const devices = await studiosApi.devices({ studioId: studioIds[0] })
Expand Down

0 comments on commit 978a09f

Please sign in to comment.