From a17d5ca6453e1f5557e3595a9d25a680f6f0e801 Mon Sep 17 00:00:00 2001 From: Geido <60598000+geido@users.noreply.github.com> Date: Tue, 2 Nov 2021 19:27:56 +0200 Subject: [PATCH] fix(Explore): Remove changes to the properties on cancel (#17184) * Remove on close * Fix lint * Add tests --- .../ExploreChartHeader/ExploreChartHeader.test.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/superset-frontend/src/explore/components/ExploreChartHeader/ExploreChartHeader.test.tsx b/superset-frontend/src/explore/components/ExploreChartHeader/ExploreChartHeader.test.tsx index 2033d3368e175..702498d39bc38 100644 --- a/superset-frontend/src/explore/components/ExploreChartHeader/ExploreChartHeader.test.tsx +++ b/superset-frontend/src/explore/components/ExploreChartHeader/ExploreChartHeader.test.tsx @@ -21,8 +21,12 @@ import React from 'react'; import { Slice } from 'src/types/Chart'; import { render, screen } from 'spec/helpers/testing-library'; import userEvent from '@testing-library/user-event'; + +import fetchMock from 'fetch-mock'; import ExploreHeader from '.'; +fetchMock.get('http://localhost/api/v1/chart/318', {}); + const createProps = () => ({ chart: { latestQueryFormData: { @@ -45,7 +49,11 @@ const createProps = () => ({ }, chartStatus: 'rendered', }, +<<<<<<< HEAD slice: { +======= + slice: ({ +>>>>>>> fix(Explore): Remove changes to the properties on cancel (#17184) cache_timeout: null, changed_on: '2021-03-19T16:30:56.750230', changed_on_humanized: '7 days ago', @@ -82,7 +90,11 @@ const createProps = () => ({ slice_id: 318, slice_name: 'Age distribution of respondents', slice_url: '/superset/explore/?form_data=%7B%22slice_id%22%3A%20318%7D', +<<<<<<< HEAD } as unknown as Slice, +======= + } as unknown) as Slice, +>>>>>>> fix(Explore): Remove changes to the properties on cancel (#17184) slice_name: 'Age distribution of respondents', actions: { postChartFormData: () => null,