diff --git a/plugins/catalog-backend/src/service/request/parseEntityTransformParams.test.ts b/plugins/catalog-backend/src/service/request/parseEntityTransformParams.test.ts index 65f85639e1..ae1c8855ea 100644 --- a/plugins/catalog-backend/src/service/request/parseEntityTransformParams.test.ts +++ b/plugins/catalog-backend/src/service/request/parseEntityTransformParams.test.ts @@ -100,7 +100,6 @@ describe('parseEntityTransformParams', () => { 'subite.with/dot': 'fd2.sub.dot', }, 'third-field-with.dot-again': 'fd3', - type: 't', }; expect( @@ -129,4 +128,23 @@ describe('parseEntityTransformParams', () => { }, }); }); + + it('does not return a sub key if an incorrect longer key is requested', () => { + entity.spec = { + ...entity.spec, + 'field-with.dot': 'fd1', + plain: true, + numLike: 4, + arrayLike: [4, 5], + }; + + expect( + parseEntityTransformParams({ + fields: + 'kind,spec.field-withdot.other.item,kind.other.other,spec.plain.other,spec.numLike.other,spec.arrayLike.other', + })!(entity), + ).toEqual({ + kind: 'k', + }); + }); });