Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 52 additions & 47 deletions packages/openapi/src/__tests__/ingest.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,6 @@ describe('Ingest API', () => {
})
})

test('Can delete multiple playlists', async () => {
const result = await ingestApi.deletePlaylists({ studioId })
expect(result).toBe(undefined)
})

test('Can delete playlist by id', async () => {
const result = await ingestApi.deletePlaylist({
studioId,
playlistId: playlistIds[0],
})
expect(result).toBe(undefined)
})

/**
* RUNDOWNS
*/
Expand Down Expand Up @@ -159,20 +146,6 @@ describe('Ingest API', () => {
expect(result).toBe(undefined)
})

test('Can delete multiple rundowns', async () => {
const result = await ingestApi.deleteRundowns({ studioId, playlistId: playlistIds[0] })
expect(result).toBe(undefined)
})

test('Can delete rundown by id', async () => {
const result = await ingestApi.deleteRundown({
studioId,
playlistId: playlistIds[0],
rundownId: updatedRundownId,
})
expect(result).toBe(undefined)
})

/**
* INGEST SEGMENT
*/
Expand Down Expand Up @@ -262,25 +235,6 @@ describe('Ingest API', () => {
expect(result).toBe(undefined)
})

test('Can delete multiple segments', async () => {
const result = await ingestApi.deleteSegments({
studioId,
playlistId: playlistIds[0],
rundownId: rundownIds[0],
})
expect(result).toBe(undefined)
})

test('Can delete segment by id', async () => {
const result = await ingestApi.deleteSegment({
studioId,
playlistId: playlistIds[0],
rundownId: rundownIds[0],
segmentId: updatedSegmentId,
})
expect(result).toBe(undefined)
})

/**
* INGEST PARTS
*/
Expand Down Expand Up @@ -401,7 +355,9 @@ describe('Ingest API', () => {

const updatedPartId = 'part2'
test('Can update a part', async () => {
newIngestPart.name = newIngestPart.name + ' added'
if (newIngestPart) {
newIngestPart.name = newIngestPart.name + ' added'
}
const result = await ingestApi.putPart({
studioId,
playlistId: playlistIds[0],
Expand Down Expand Up @@ -431,6 +387,9 @@ describe('Ingest API', () => {
expect(result).toBe(undefined)
})

/**
* DELETIONS - All delete tests at the end to avoid breaking subsequent tests
*/
test('Can delete multiple parts', async () => {
const result = await ingestApi.deleteParts({
studioId,
Expand All @@ -451,4 +410,50 @@ describe('Ingest API', () => {
})
expect(result).toBe(undefined)
})

test('Can delete multiple segments', async () => {
const result = await ingestApi.deleteSegments({
studioId,
playlistId: playlistIds[0],
rundownId: rundownIds[0],
})
expect(result).toBe(undefined)
})

test('Can delete segment by id', async () => {
const result = await ingestApi.deleteSegment({
studioId,
playlistId: playlistIds[0],
rundownId: rundownIds[0],
segmentId: updatedSegmentId,
})
expect(result).toBe(undefined)
})

test('Can delete multiple rundowns', async () => {
const result = await ingestApi.deleteRundowns({ studioId, playlistId: playlistIds[0] })
expect(result).toBe(undefined)
})

test('Can delete rundown by id', async () => {
const result = await ingestApi.deleteRundown({
studioId,
playlistId: playlistIds[0],
rundownId: updatedRundownId,
})
expect(result).toBe(undefined)
})

test('Can delete multiple playlists', async () => {
const result = await ingestApi.deletePlaylists({ studioId })
expect(result).toBe(undefined)
})

test('Can delete playlist by id', async () => {
const result = await ingestApi.deletePlaylist({
studioId,
playlistId: playlistIds[0],
})
expect(result).toBe(undefined)
})
})
Loading