diff --git a/x-pack/plugins/uptime/server/legacy_uptime/routes/pings/journey_screenshots.test.ts b/x-pack/plugins/uptime/server/legacy_uptime/routes/pings/journey_screenshots.test.ts index bfec3dcaa265c2..1a0b1c0c39d9b4 100644 --- a/x-pack/plugins/uptime/server/legacy_uptime/routes/pings/journey_screenshots.test.ts +++ b/x-pack/plugins/uptime/server/legacy_uptime/routes/pings/journey_screenshots.test.ts @@ -105,94 +105,6 @@ describe('journey screenshot route', () => { expect(response.body.screenshotRef).toEqual(mock); }); - it('returns full screenshot blob', async () => { - const mock = { - synthetics: { - blob: 'a blob', - blob_mime: 'image/jpeg', - step: { - name: 'a step name', - }, - type: 'step/screenshot', - }, - }; - - handlerContext.uptimeEsClient.search = jest.fn().mockResolvedValue({ - body: { - hits: { - total: { - value: 3, - }, - hits: [], - }, - aggregations: { step: { image: { hits: { hits: [{ _source: mock }] } } } }, - }, - }); - - const route = createJourneyScreenshotRoute({ - requests: { - getJourneyScreenshot: jest.fn().mockReturnValue(mock), - }, - } as unknown as UMServerLibs); - - expect(await route.handler(handlerContext as any)).toMatchInlineSnapshot(` - Object { - "body": Object { - "data": Array [ - 105, - 185, - 104, - ], - "type": "Buffer", - }, - "headers": Object { - "cache-control": "max-age=600", - "caption-name": "a step name", - "content-type": "image/jpeg", - "max-steps": "3", - }, - "message": "Ok", - "status": 200, - } - `); - }); - - it('defaults to png when mime is undefined', async () => { - const mock = { - synthetics: { - blob: 'a blob', - step: { - name: 'a step name', - }, - type: 'step/screenshot', - }, - }; - handlerContext.uptimeEsClient.search = jest.fn().mockResolvedValue({ - body: { - hits: { - total: { - value: 3, - }, - hits: [], - }, - aggregations: { step: { image: { hits: { hits: [{ _source: mock }] } } } }, - }, - }); - const route = createJourneyScreenshotRoute({ - requests: { - getJourneyScreenshot: jest.fn().mockReturnValue(mock), - }, - } as unknown as UMServerLibs); - - const response = (await route.handler( - handlerContext as any - )) as IKibanaResponse; - - expect(response.status).toBe(200); - // @ts-expect-error incomplete implementation for testing - expect(response.headers['content-type']).toBe('image/png'); - }); - it('returns 404 for screenshot missing blob', async () => { const route = createJourneyScreenshotRoute({ requests: {