mirror of
https://github.com/apache/superset.git
synced 2026-04-24 02:25:13 +00:00
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:
committed by
GitHub
parent
a6bf95e30b
commit
d8373f2bb9
@@ -74,11 +74,22 @@ describe('SavedQueries', () => {
|
||||
user: {
|
||||
userId: '1',
|
||||
},
|
||||
mine: mockqueries,
|
||||
};
|
||||
|
||||
const wrapper = mount(<SavedQueries {...savedQueryProps} />, {
|
||||
context: { store },
|
||||
});
|
||||
|
||||
const clickTab = (idx: number) => {
|
||||
act(() => {
|
||||
const handler = wrapper.find('li.no-router a').at(idx).prop('onClick');
|
||||
if (handler) {
|
||||
handler({} as any);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
beforeAll(async () => {
|
||||
await waitForComponentToPaint(wrapper);
|
||||
});
|
||||
@@ -87,20 +98,19 @@ describe('SavedQueries', () => {
|
||||
expect(wrapper.find(SavedQueries)).toExist();
|
||||
});
|
||||
|
||||
it('fetches queries favorites and renders listviewcard cards', async () => {
|
||||
clickTab(0);
|
||||
await waitForComponentToPaint(wrapper);
|
||||
expect(fetchMock.calls(/saved_query\/\?q/)).toHaveLength(1);
|
||||
expect(wrapper.find('ListViewCard')).toExist();
|
||||
});
|
||||
|
||||
it('it renders a submenu with clickable tables and buttons', async () => {
|
||||
expect(wrapper.find(SubMenu)).toExist();
|
||||
expect(wrapper.find('li')).toHaveLength(2);
|
||||
expect(wrapper.find('button')).toHaveLength(2);
|
||||
act(() => {
|
||||
wrapper.find('li').at(1).simulate('click');
|
||||
});
|
||||
|
||||
clickTab(1);
|
||||
await waitForComponentToPaint(wrapper);
|
||||
expect(fetchMock.calls(/saved_query\/\?q/)).toHaveLength(1);
|
||||
});
|
||||
|
||||
it('fetches queries favorites and renders listviewcard cards', () => {
|
||||
expect(fetchMock.calls(/saved_query\/\?q/)).toHaveLength(1);
|
||||
expect(wrapper.find('ListViewCard')).toExist();
|
||||
expect(fetchMock.calls(/saved_query\/\?q/)).toHaveLength(2);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user