Skip to content

Commit

Permalink
fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AAfghahi committed Mar 22, 2022
1 parent 4c4fcb4 commit 6e342be
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,17 @@ export class ExploreChartHeader extends React.PureComponent {

async fetchChartDashboardData() {
const { dashboardId, slice } = this.props;
const response = await SupersetClient.get({
await SupersetClient.get({
endpoint: `/api/v1/chart/${slice.slice_id}`,
});
const chart = response.json.result;
const dashboards = chart.dashboards || [];
const dashboard =
dashboardId &&
dashboards.length &&
dashboards.find(d => d.id === dashboardId);
})
.then(res => {
const response = res?.json?.result;
if (response && response.dashboards && response.dashboards.length) {
const { dashboards } = response;
const dashboard =
dashboardId &&
dashboards.length &&
dashboards.find(d => d.id === dashboardId);

if (dashboard && dashboard.json_metadata) {
// setting the chart to use the dashboard custom label colors if any
Expand Down
2 changes: 2 additions & 0 deletions tests/integration_tests/reports/api_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,11 +273,13 @@ def test_get_list_report_schedule(self):
"changed_by",
"changed_on",
"changed_on_delta_humanized",
"chart_id",
"created_by",
"created_on",
"creation_method",
"crontab",
"crontab_humanized",
"dashboard_id",
"description",
"id",
"last_eval_dttm",
Expand Down

0 comments on commit 6e342be

Please sign in to comment.