mirror of
https://github.com/apache/superset.git
synced 2026-04-17 07:05:04 +00:00
[js-testing] add tests for explore actions (#2976)
* move to explore folder and delete explorev2 folder * add tests for fetchDatasourceMetadata * tests for fetchDatasources, fetchDatasourceMetadata * use $.ajax for fetch dashboards and write test
This commit is contained in:
@@ -194,16 +194,19 @@ export function fetchDashboardsFailed(userId) {
|
||||
export function fetchDashboards(userId) {
|
||||
return function (dispatch) {
|
||||
const url = '/dashboardmodelviewasync/api/read?_flt_0_owners=' + userId;
|
||||
$.get(url, function (data, status) {
|
||||
if (status === 'success') {
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url,
|
||||
success: (data) => {
|
||||
const choices = [];
|
||||
for (let i = 0; i < data.pks.length; i++) {
|
||||
choices.push({ value: data.pks[i], label: data.result[i].dashboard_title });
|
||||
}
|
||||
dispatch(fetchDashboardsSucceeded(choices));
|
||||
} else {
|
||||
},
|
||||
error: () => {
|
||||
dispatch(fetchDashboardsFailed(userId));
|
||||
}
|
||||
},
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user