mirror of
https://github.com/apache/superset.git
synced 2026-04-20 08:34:37 +00:00
feat: filter by me on CRUD list view (#11683)
This commit is contained in:
@@ -56,6 +56,10 @@ const mockdatabases = [...new Array(3)].map((_, i) => ({
|
||||
id: i,
|
||||
}));
|
||||
|
||||
const mockUser = {
|
||||
userId: 1,
|
||||
};
|
||||
|
||||
fetchMock.get(databasesInfoEndpoint, {
|
||||
permissions: ['can_delete'],
|
||||
});
|
||||
@@ -77,7 +81,9 @@ fetchMock.get(databaseRelatedEndpoint, {
|
||||
});
|
||||
|
||||
describe('DatabaseList', () => {
|
||||
const wrapper = mount(<DatabaseList />, { context: { store } });
|
||||
const wrapper = mount(<DatabaseList user={mockUser} />, {
|
||||
context: { store },
|
||||
});
|
||||
|
||||
beforeAll(async () => {
|
||||
await waitForComponentToPaint(wrapper);
|
||||
|
||||
@@ -52,6 +52,10 @@ const mockdatasets = [...new Array(3)].map((_, i) => ({
|
||||
table_name: `coolest table ${i}`,
|
||||
}));
|
||||
|
||||
const mockUser = {
|
||||
userId: 1,
|
||||
};
|
||||
|
||||
fetchMock.get(datasetsInfoEndpoint, {
|
||||
permissions: ['can_list', 'can_edit', 'can_add', 'can_delete'],
|
||||
});
|
||||
@@ -70,7 +74,7 @@ fetchMock.get(databaseEndpoint, {
|
||||
});
|
||||
|
||||
async function mountAndWait(props) {
|
||||
const mounted = mount(<DatasetList {...props} />, {
|
||||
const mounted = mount(<DatasetList {...props} user={mockUser} />, {
|
||||
context: { store },
|
||||
});
|
||||
await waitForComponentToPaint(mounted);
|
||||
|
||||
@@ -91,7 +91,9 @@ fetchMock.get(queriesDistinctEndpoint, {
|
||||
});
|
||||
|
||||
describe('SavedQueryList', () => {
|
||||
const wrapper = mount(<SavedQueryList />, { context: { store } });
|
||||
const wrapper = mount(<SavedQueryList />, {
|
||||
context: { store },
|
||||
});
|
||||
|
||||
beforeAll(async () => {
|
||||
await waitForComponentToPaint(wrapper);
|
||||
|
||||
Reference in New Issue
Block a user