Skip to content

Commit

Permalink
fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Grace Guo committed Mar 8, 2022
1 parent 28f8d4d commit e0a26d0
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions superset-frontend/src/visualizations/TimeTable/sort.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/

import { Row } from 'react-table';
import sortFn from './SortNumberWithMixedTypes';

describe('sort Number and mixed types', () => {
Expand All @@ -30,7 +30,7 @@ describe('sort Number and mixed types', () => {
},
},
},
};
} as unknown as Row;
const rowB = {
values: {
metric: 'Afghanistan',
Expand All @@ -40,7 +40,7 @@ describe('sort Number and mixed types', () => {
},
},
},
};
} as unknown as Row;
const rowC = {
values: {
metric: 'Malawi',
Expand All @@ -50,14 +50,11 @@ describe('sort Number and mixed types', () => {
},
},
},
};
} as unknown as Row;

it('should treat null values as smallest', () => {
// @ts-ignore
expect(sortFn(rowA, rowB, columnId)).toBe(-1);
// @ts-ignore
expect(sortFn(rowA, rowC, columnId)).toBe(-1);
// @ts-ignore
expect(sortFn(rowB, rowC, columnId)).toBe(
rowB.values[columnId].props['data-value'] -
rowC.values[columnId].props['data-value'],
Expand Down

0 comments on commit e0a26d0

Please sign in to comment.