Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
betodealmeida committed Apr 24, 2023
1 parent 5e6d713 commit 84227ec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ export default function buildQuery(formData: PivotTableQueryFormData) {
/* Charts created before `GENERIC_CHART_AXES` is enabled have a different
* form data, with `granularity_sqla` set instead.
*/
(formData?.temporal_columns_lookup?.[col] || formData.granularity_sqla)
(formData?.temporal_columns_lookup?.[col] ||
formData.granularity_sqla === col)
) {
return {
timeGrain: formData.time_grain_sqla,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
*/

import { TimeGranularity } from '@superset-ui/core';
import * as supersetCoreModule from '@superset-ui/core';
import buildQuery from '../../src/plugin/buildQuery';
import { PivotTableQueryFormData } from '../../src/types';
import * as buildQueryModule from '../../src/plugin/buildQuery';

describe('PivotTableChart buildQuery', () => {
const formData: PivotTableQueryFormData = {
Expand Down Expand Up @@ -59,7 +59,7 @@ describe('PivotTableChart buildQuery', () => {
});

it('should work with old charts after GENERIC_CHART_AXES is enabled', () => {
Object.defineProperty(buildQueryModule, 'hasGenericChartAxes', {
Object.defineProperty(supersetCoreModule, 'hasGenericChartAxes', {
value: true,
});
const modifiedFormData = {
Expand Down

0 comments on commit 84227ec

Please sign in to comment.