diff --git a/src/test/CreateRecording/SnapshotRecordingForm.test.tsx b/src/test/CreateRecording/SnapshotRecordingForm.test.tsx index 35e097f217..99725f97fc 100644 --- a/src/test/CreateRecording/SnapshotRecordingForm.test.tsx +++ b/src/test/CreateRecording/SnapshotRecordingForm.test.tsx @@ -16,6 +16,7 @@ import { SnapshotRecordingForm } from '@app/CreateRecording/SnapshotRecordingForm'; import { authFailMessage } from '@app/ErrorView/types'; +import { ActiveRecording, RecordingState } from '@app/Shared/Services/api.types'; import { ServiceContext, Services, defaultServices } from '@app/Shared/Services/Services'; import { TargetService } from '@app/Shared/Services/Target.service'; import { screen, cleanup, act as doAct } from '@testing-library/react'; @@ -31,6 +32,23 @@ const mockTarget = { labels: [], annotations: { cryostat: [], platform: [] }, }; +const mockRecording: ActiveRecording = { + id: 100, + state: RecordingState.RUNNING, + duration: 1010, + startTime: 9999, + continuous: false, + toDisk: false, + maxSize: 55, + maxAge: 66, + remoteId: 77, + name: 'snapshot-10', + downloadUrl: 'http://localhost:8080/api/v4/targets/1/recordings/77', + reportUrl: 'http://localhost:8080/api/v4/targets/1/reports/77', + metadata: { + labels: [], + }, +}; jest.spyOn(defaultServices.target, 'authFailure').mockReturnValue(of()); jest.spyOn(defaultServices.target, 'target').mockReturnValue(of(mockTarget)); @@ -67,7 +85,7 @@ describe('', () => { }); it('should create Recording when create is clicked', async () => { - const onCreateSpy = jest.spyOn(defaultServices.api, 'createSnapshot').mockReturnValue(of(true)); + const onCreateSpy = jest.spyOn(defaultServices.api, 'createSnapshot').mockReturnValue(of(mockRecording)); const { user } = render({ routerConfigs: { routes: [ diff --git a/src/test/RecordingMetadata/BulkEditLabels.test.tsx b/src/test/RecordingMetadata/BulkEditLabels.test.tsx index 231de207fe..72834aa821 100644 --- a/src/test/RecordingMetadata/BulkEditLabels.test.tsx +++ b/src/test/RecordingMetadata/BulkEditLabels.test.tsx @@ -72,6 +72,7 @@ const mockActiveRecording: ActiveRecording = { toDisk: false, maxSize: 0, maxAge: 0, + remoteId: 9876, }; const mockActiveLabelsNotification = { diff --git a/src/test/Recordings/Filters/DurationFilter.test.tsx b/src/test/Recordings/Filters/DurationFilter.test.tsx index a9ab621177..7cf72d149b 100644 --- a/src/test/Recordings/Filters/DurationFilter.test.tsx +++ b/src/test/Recordings/Filters/DurationFilter.test.tsx @@ -38,6 +38,7 @@ const mockRecording: ActiveRecording = { toDisk: false, maxSize: 0, maxAge: 0, + remoteId: 8765, }; const onDurationInput = jest.fn((_durationInput) => undefined); diff --git a/src/test/Recordings/Filters/LabelFilter.test.tsx b/src/test/Recordings/Filters/LabelFilter.test.tsx index 2e8b1ec7b1..a055b3e38e 100644 --- a/src/test/Recordings/Filters/LabelFilter.test.tsx +++ b/src/test/Recordings/Filters/LabelFilter.test.tsx @@ -46,6 +46,7 @@ const mockRecording: ActiveRecording = { toDisk: false, maxSize: 0, maxAge: 0, + remoteId: 6543, }; const mockAnotherRecording = { ...mockRecording, diff --git a/src/test/Recordings/Filters/NameFilter.test.tsx b/src/test/Recordings/Filters/NameFilter.test.tsx index 2d04b37b5d..ae5ab44987 100644 --- a/src/test/Recordings/Filters/NameFilter.test.tsx +++ b/src/test/Recordings/Filters/NameFilter.test.tsx @@ -38,6 +38,7 @@ const mockRecording: ActiveRecording = { toDisk: false, maxSize: 0, maxAge: 0, + remoteId: 5432, }; const mockAnotherRecording = { ...mockRecording, name: 'anotherRecording' }; const mockRecordingList = [mockRecording, mockAnotherRecording]; diff --git a/src/test/Recordings/Filters/RecordingStateFilter.test.tsx b/src/test/Recordings/Filters/RecordingStateFilter.test.tsx index d576b621ca..6ddbe29e21 100644 --- a/src/test/Recordings/Filters/RecordingStateFilter.test.tsx +++ b/src/test/Recordings/Filters/RecordingStateFilter.test.tsx @@ -38,6 +38,7 @@ const mockRecording: ActiveRecording = { toDisk: false, maxSize: 0, maxAge: 0, + remoteId: 4321, }; const mockAnotherRecording = { ...mockRecording, diff --git a/src/test/Recordings/RecordingFilters.test.tsx b/src/test/Recordings/RecordingFilters.test.tsx index 1bd9406454..5050beff33 100644 --- a/src/test/Recordings/RecordingFilters.test.tsx +++ b/src/test/Recordings/RecordingFilters.test.tsx @@ -65,6 +65,7 @@ const mockActiveRecording: ActiveRecording = { toDisk: false, maxSize: 0, maxAge: 0, + remoteId: 3210, }; const mockActiveRecordingList = [ mockActiveRecording,