chore(home-screen): fixes for loading states, flicker issue, and reduction of api calls (#11557)

* fixes for loading states, flicker issue, api calls

* fix filter bug

* add high res images

* bug fixes for cards and face pile, change imgs to svgs, and address comments

* update from comments

* add stopprop

* fix tests

* add liscenses

* remove unused type

* fix types

* add license

* fix lint
This commit is contained in:
Phillip Kelley-Dotson
2020-11-06 22:35:13 -05:00
committed by GitHub
parent a6bf95e30b
commit d8373f2bb9
30 changed files with 730 additions and 324 deletions

View File

@@ -22,6 +22,7 @@ import thunk from 'redux-thunk';
import fetchMock from 'fetch-mock';
import configureStore from 'redux-mock-store';
import { act } from 'react-dom/test-utils';
import ChartTable from 'src/views/CRUD/welcome/ChartTable';
import waitForComponentToPaint from 'spec/helpers/waitForComponentToPaint';
@@ -64,8 +65,14 @@ describe('ChartTable', () => {
});
it('fetches chart favorites and renders chart cards ', async () => {
expect(fetchMock.calls(chartsEndpoint)).toHaveLength(1);
act(() => {
const handler = wrapper.find('li.no-router a').at(0).prop('onClick');
if (handler) {
handler({} as any);
}
});
await waitForComponentToPaint(wrapper);
expect(fetchMock.calls(chartsEndpoint)).toHaveLength(1);
expect(wrapper.find('ChartCard')).toExist();
});