Merge branch 'backstage:master' into feature/set-default-type-filter-for-search

This commit is contained in:
Alexander Vödisch
2026-01-26 11:21:00 +01:00
committed by GitHub
1562 changed files with 64890 additions and 21690 deletions
@@ -40,6 +40,7 @@ export default {
},
),
],
tags: ['!manifest'],
};
export const Default = () => {
@@ -46,12 +46,7 @@ describe('<HomePageSearchBar/>', () => {
},
);
expect(searchApiMock.query).toHaveBeenCalledWith(
expect.objectContaining({ term: '' }),
{
signal: expect.any(AbortSignal),
},
);
expect(searchApiMock.query).not.toHaveBeenCalled();
await userEvent.type(screen.getByLabelText('Search'), 'term{enter}');
@@ -85,6 +85,7 @@ export default {
{ mountedRoutes: { '/search': rootRouteRef } },
),
],
tags: ['!manifest'],
};
export const Default = () => {
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { screen } from '@testing-library/react';
import { screen, waitFor } from '@testing-library/react';
import { renderInTestApp, TestApiRegistry } from '@backstage/test-utils';
import userEvent from '@testing-library/user-event';
import { configApiRef } from '@backstage/core-plugin-api';
@@ -63,7 +63,6 @@ describe('SearchModal', () => {
);
expect(screen.getByRole('dialog')).toBeInTheDocument();
expect(searchApiMock.query).toHaveBeenCalledTimes(1);
});
it('Should use parent search context if defined', async () => {
@@ -106,15 +105,21 @@ describe('SearchModal', () => {
);
expect(screen.getByRole('dialog')).toBeInTheDocument();
expect(searchApiMock.query).toHaveBeenCalledWith(
{
term: '',
filters: {},
types: [],
pageCursor: undefined,
},
{ signal: expect.any(AbortSignal) },
);
const input = screen.getByLabelText<HTMLInputElement>('Search');
await userEvent.type(input, 'text');
await waitFor(() => {
expect(searchApiMock.query).toHaveBeenCalledWith(
{
term: 'text',
filters: {},
types: [],
pageCursor: undefined,
},
{ signal: expect.any(AbortSignal) },
);
});
});
it('Should render a custom Modal correctly', async () => {
@@ -146,7 +151,6 @@ describe('SearchModal', () => {
},
);
expect(searchApiMock.query).toHaveBeenCalledTimes(1);
await userEvent.keyboard('{Escape}');
expect(toggleModal).toHaveBeenCalledTimes(1);
});
@@ -45,7 +45,7 @@ export const UrlUpdater = () => {
}
const query =
qs.parse(location.search.substring(1), { arrayLimit: 0 }) || {};
qs.parse(location.search.substring(1), { arrayLimit: 10000 }) || {};
if (query.filters) {
setFilters(query.filters as JsonObject);
@@ -43,7 +43,7 @@ export const UrlUpdater = () => {
}
const query =
qs.parse(location.search.substring(1), { arrayLimit: 0 }) || {};
qs.parse(location.search.substring(1), { arrayLimit: 10000 }) || {};
if (query.filters) {
setFilters(query.filters as JsonObject);
@@ -44,6 +44,7 @@ export default {
</TestApiProvider>
),
],
tags: ['!manifest'],
};
const values = ['value-1', 'value-2', 'value-3'];