import {
initializeMocks,
render,
screen,
} from '../../testUtils';
import {
mockGetContentLibraryV2List,
} from '../data/api.mocks';
import { ComponentPicker } from './ComponentPicker';
describe('', () => {
beforeEach(() => {
initializeMocks();
});
it('should render the library list', async () => {
mockGetContentLibraryV2List.applyMock();
render();
expect(await screen.findByText('Test Library 1')).toBeInTheDocument();
expect(await screen.findByText('Test Library 1')).toBeInTheDocument();
});
it('should render the loading status', async () => {
mockGetContentLibraryV2List.applyMockLoading();
render();
expect(await screen.findByText('Loading...')).toBeInTheDocument();
});
it('should render the empty status', async () => {
mockGetContentLibraryV2List.applyMockEmpty();
render();
expect(await screen.findByText(/there are no libraries with the current filters/i)).toBeInTheDocument();
});
it('should render the error status', async () => {
mockGetContentLibraryV2List.applyMockError();
render();
expect(await screen.findByText(/mocked request failed with status code 500/i)).toBeInTheDocument();
});
});