feat(listview): skeleton loading states for table and card collections (#10606)

This commit is contained in:
ʈᵃᵢ
2020-08-21 10:32:37 -07:00
committed by GitHub
parent 878f06d133
commit b86c0e5727
18 changed files with 456 additions and 95 deletions

View File

@@ -47,6 +47,7 @@ const mockCharts = [...new Array(3)].map((_, i) => ({
url: 'url',
viz_type: 'bar',
datasource_name: `ds${i}`,
thumbnail_url: '/thumbnail',
}));
fetchMock.get(chartsInfoEndpoint, {
@@ -70,6 +71,9 @@ fetchMock.get(chartsDtasourcesEndpoint, {
count: 0,
});
global.URL.createObjectURL = jest.fn();
fetchMock.get('/thumbnail', { body: new Blob(), sendAsJson: false });
describe('ChartList', () => {
const mockedProps = {};
const wrapper = mount(<ChartList {...mockedProps} />, {

View File

@@ -48,6 +48,7 @@ const mockDashboards = [...new Array(3)].map((_, i) => ({
changed_on_utc: new Date().toISOString(),
changed_on_delta_humanized: '5 minutes ago',
owners: [{ first_name: 'admin', last_name: 'admin_user' }],
thumbnail_url: '/thumbnail',
}));
fetchMock.get(dashboardsInfoEndpoint, {
@@ -61,6 +62,9 @@ fetchMock.get(dashboardsEndpoint, {
dashboard_count: 3,
});
global.URL.createObjectURL = jest.fn();
fetchMock.get('/thumbnail', { body: new Blob(), sendAsJson: false });
describe('DashboardList', () => {
const mockedProps = {};
const wrapper = mount(<DashboardList {...mockedProps} />, {