From 3125f54ad63f18bd374a0cc47cf304a14fa8fb5f Mon Sep 17 00:00:00 2001 From: Kiss Miklos Date: Tue, 28 Jun 2022 10:14:07 +0200 Subject: [PATCH] fix UrlReaderProcessor test Signed-off-by: Kiss Miklos --- .../modules/core/UrlReaderProcessor.test.ts | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/plugins/catalog-backend/src/modules/core/UrlReaderProcessor.test.ts b/plugins/catalog-backend/src/modules/core/UrlReaderProcessor.test.ts index ecb0eb30d3..631f463fd5 100644 --- a/plugins/catalog-backend/src/modules/core/UrlReaderProcessor.test.ts +++ b/plugins/catalog-backend/src/modules/core/UrlReaderProcessor.test.ts @@ -61,7 +61,13 @@ describe('UrlReaderProcessor', () => { server.use( rest.get(`${mockApiOrigin}/component.yaml`, (_, res, ctx) => - res(ctx.set({ ETag: 'my-etag' }), ctx.json({ mock: 'entity' })), + res( + ctx.set({ ETag: 'my-etag' }), + ctx.json({ + kind: 'component', + metadata: { name: 'mock-url-entity' }, + }), + ), ), ); @@ -78,11 +84,17 @@ describe('UrlReaderProcessor', () => { expect(emitted[0]).toEqual({ type: 'entity', location: spec, - entity: { mock: 'entity' }, + entity: { kind: 'component', metadata: { name: 'mock-url-entity' } }, }); expect(mockCache.set).toBeCalledWith('v1', { etag: 'my-etag', - value: [{ type: 'entity', location: spec, entity: { mock: 'entity' } }], + value: [ + { + type: 'entity', + location: spec, + entity: { kind: 'component', metadata: { name: 'mock-url-entity' } }, + }, + ], }); expect(mockCache.set).toBeCalledTimes(1); });