implement the beginnings of mockApis
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { MockConfigApi, TestApiProvider } from '@backstage/test-utils';
|
||||
import { mockApis, TestApiProvider } from '@backstage/test-utils';
|
||||
import { act, render, waitFor } from '@testing-library/react';
|
||||
import user from '@testing-library/user-event';
|
||||
import {
|
||||
@@ -41,10 +41,12 @@ jest.mock('@backstage/plugin-search-react', () => ({
|
||||
}));
|
||||
|
||||
describe('SearchType.Accordion', () => {
|
||||
const configApiMock = new MockConfigApi({
|
||||
search: {
|
||||
query: {
|
||||
pagelimit: 10,
|
||||
const configApiMock = mockApis.config({
|
||||
data: {
|
||||
search: {
|
||||
query: {
|
||||
pagelimit: 10,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { MockConfigApi, TestApiProvider } from '@backstage/test-utils';
|
||||
import { mockApis, TestApiProvider } from '@backstage/test-utils';
|
||||
import { act, render } from '@testing-library/react';
|
||||
import user from '@testing-library/user-event';
|
||||
import {
|
||||
@@ -40,10 +40,12 @@ jest.mock('@backstage/plugin-search-react', () => ({
|
||||
|
||||
describe('SearchType.Tabs', () => {
|
||||
const searchApiMock = { query: jest.fn().mockResolvedValue({ results: [] }) };
|
||||
const configApiMock = new MockConfigApi({
|
||||
search: {
|
||||
query: {
|
||||
pageLimit: 100,
|
||||
const configApiMock = mockApis.config({
|
||||
data: {
|
||||
search: {
|
||||
query: {
|
||||
pageLimit: 100,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
@@ -23,7 +23,7 @@ import {
|
||||
searchApiRef,
|
||||
} from '@backstage/plugin-search-react';
|
||||
import { SearchType } from './SearchType';
|
||||
import { MockConfigApi, TestApiProvider } from '@backstage/test-utils';
|
||||
import { mockApis, TestApiProvider } from '@backstage/test-utils';
|
||||
|
||||
describe('SearchType', () => {
|
||||
const initialState = {
|
||||
@@ -36,10 +36,12 @@ describe('SearchType', () => {
|
||||
const values = ['value1', 'value2'];
|
||||
const typeValues = ['preselected'];
|
||||
|
||||
const configApiMock = new MockConfigApi({
|
||||
search: {
|
||||
query: {
|
||||
pagelimit: 10,
|
||||
const configApiMock = mockApis.config({
|
||||
data: {
|
||||
search: {
|
||||
query: {
|
||||
pagelimit: 10,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user