chore: Show datasets when search input is empty (#12391)

This commit is contained in:
Geido
2021-01-11 23:06:57 +01:00
committed by GitHub
parent ddbcf5b0e9
commit 376723a1f5
3 changed files with 17 additions and 10 deletions

View File

@@ -81,19 +81,24 @@ describe('ChangeDatasourceModal', () => {
});
it('fetches datasources', async () => {
expect(fetchMock.calls(/api\/v1\/dataset/)).toHaveLength(6);
expect(fetchMock.calls(/api\/v1\/dataset/)).toHaveLength(3);
});
it('renders confirmation message', async () => {
await waitForComponentToPaint(wrapper, 1000);
act(() => {
wrapper.find('[data-test="datasource-link"]').at(0).props().onClick();
});
await waitForComponentToPaint(wrapper);
expect(wrapper.find('.proceed-btn')).toExist();
});
it('changes the datasource', async () => {
await waitForComponentToPaint(wrapper, 1000);
act(() => {
wrapper.find('[data-test="datasource-link"]').at(0).props().onClick();
});