diff --git a/plugins/catalog-react/src/components/UserListPicker/UserListPicker.test.tsx b/plugins/catalog-react/src/components/UserListPicker/UserListPicker.test.tsx index f0b82b550e..63228717a5 100644 --- a/plugins/catalog-react/src/components/UserListPicker/UserListPicker.test.tsx +++ b/plugins/catalog-react/src/components/UserListPicker/UserListPicker.test.tsx @@ -523,9 +523,7 @@ describe('', () => { return mockQueryEntitiesImplementation(request); }); - render( - , - ); /* picker({ loading: true })*/ + render(); await waitFor(() => expect(mockCatalogApi.queryEntities).toHaveBeenCalledTimes(3), @@ -566,9 +564,7 @@ describe('', () => { return mockQueryEntitiesImplementation(request); }); - render( - , - ); /* picker({ loading: true })*/ + render(); await waitFor(() => expect(mockCatalogApi.queryEntities).toHaveBeenCalledTimes(3), @@ -587,7 +583,10 @@ describe('', () => { await waitFor(() => expect(updateFilters).toHaveBeenLastCalledWith({ - user: EntityUserListFilter.starred(expect.any(Array)), + user: EntityUserListFilter.starred([ + 'component:default/e-1', + 'component:default/e-2', + ]), }), ); }); diff --git a/plugins/catalog-react/src/filters.ts b/plugins/catalog-react/src/filters.ts index b94b538802..74ab771999 100644 --- a/plugins/catalog-react/src/filters.ts +++ b/plugins/catalog-react/src/filters.ts @@ -241,11 +241,11 @@ export class EntityUserListFilter implements EntityFilter { // This is supposed to return always true for paginated // owned entities, since the filters are applied server side. if (this.value === 'owned') { + const relations = getEntityRelations(entity, RELATION_OWNED_BY); + return ( this.refs?.some(v => - getEntityRelations(entity, RELATION_OWNED_BY).some( - o => stringifyEntityRef(o) === v, - ), + relations.some(o => stringifyEntityRef(o) === v), ) ?? false ); } @@ -309,9 +309,6 @@ export class EntityOrphanFilter implements EntityFilter { export class EntityErrorFilter implements EntityFilter { constructor(readonly value: boolean) {} - // TODO(vinzscam): is it possible to implement - // getCatalogFilters? ask mammals - filterEntity(entity: Entity): boolean { const error = ((entity as AlphaEntity)?.status?.items?.length as number) > 0;