mirror of
https://github.com/apache/superset.git
synced 2026-05-07 08:54:23 +00:00
chore(lint): migrate Jest lint rules from eslint to oxlint (#37787)
Signed-off-by: hainenber <dotronghai96@gmail.com>
This commit is contained in:
@@ -31,7 +31,7 @@ import {
|
||||
describe('buildQueryObject', () => {
|
||||
let query: QueryObject;
|
||||
|
||||
it('should build granularity for sqlalchemy datasources', () => {
|
||||
test('should build granularity for sqlalchemy datasources', () => {
|
||||
query = buildQueryObject({
|
||||
datasource: '5__table',
|
||||
granularity_sqla: 'ds',
|
||||
@@ -40,7 +40,7 @@ describe('buildQueryObject', () => {
|
||||
expect(query.granularity).toEqual('ds');
|
||||
});
|
||||
|
||||
it('should build metrics based on default queryFields', () => {
|
||||
test('should build metrics based on default queryFields', () => {
|
||||
query = buildQueryObject({
|
||||
datasource: '5__table',
|
||||
granularity_sqla: 'ds',
|
||||
@@ -51,7 +51,7 @@ describe('buildQueryObject', () => {
|
||||
expect(query.metrics).toEqual(['sum__num', 'avg__num']);
|
||||
});
|
||||
|
||||
it('should merge original and append filters', () => {
|
||||
test('should merge original and append filters', () => {
|
||||
query = buildQueryObject({
|
||||
datasource: '5__table',
|
||||
granularity_sqla: 'ds',
|
||||
@@ -84,7 +84,7 @@ describe('buildQueryObject', () => {
|
||||
expect(query.extras?.where).toEqual('(a = b) AND ((1 = 1))');
|
||||
});
|
||||
|
||||
it('should group custom metric control', () => {
|
||||
test('should group custom metric control', () => {
|
||||
query = buildQueryObject(
|
||||
{
|
||||
datasource: '5__table',
|
||||
@@ -97,7 +97,7 @@ describe('buildQueryObject', () => {
|
||||
expect(query.metrics).toEqual(['sum__num']);
|
||||
});
|
||||
|
||||
it('should group custom metric control with predefined metrics', () => {
|
||||
test('should group custom metric control with predefined metrics', () => {
|
||||
query = buildQueryObject(
|
||||
{
|
||||
datasource: '5__table',
|
||||
@@ -111,7 +111,7 @@ describe('buildQueryObject', () => {
|
||||
expect(query.metrics).toEqual(['sum__num', 'avg__num']);
|
||||
});
|
||||
|
||||
it('should build series_limit from legacy control', () => {
|
||||
test('should build series_limit from legacy control', () => {
|
||||
const series_limit = 2;
|
||||
query = buildQueryObject({
|
||||
datasource: '5__table',
|
||||
@@ -122,7 +122,7 @@ describe('buildQueryObject', () => {
|
||||
expect(query.series_limit).toEqual(series_limit);
|
||||
});
|
||||
|
||||
it('should build series_limit', () => {
|
||||
test('should build series_limit', () => {
|
||||
const series_limit = 2;
|
||||
query = buildQueryObject({
|
||||
datasource: '5__table',
|
||||
@@ -133,7 +133,7 @@ describe('buildQueryObject', () => {
|
||||
expect(query.series_limit).toEqual(series_limit);
|
||||
});
|
||||
|
||||
it('should build order_desc', () => {
|
||||
test('should build order_desc', () => {
|
||||
const orderDesc = false;
|
||||
query = buildQueryObject({
|
||||
datasource: '5__table',
|
||||
@@ -144,7 +144,7 @@ describe('buildQueryObject', () => {
|
||||
expect(query.order_desc).toEqual(orderDesc);
|
||||
});
|
||||
|
||||
it('should build series_limit_metric from legacy control', () => {
|
||||
test('should build series_limit_metric from legacy control', () => {
|
||||
const metric = 'country';
|
||||
query = buildQueryObject({
|
||||
datasource: '5__table',
|
||||
@@ -155,7 +155,7 @@ describe('buildQueryObject', () => {
|
||||
expect(query.series_limit_metric).toEqual(metric);
|
||||
});
|
||||
|
||||
it('should build series_limit_metric', () => {
|
||||
test('should build series_limit_metric', () => {
|
||||
const metric = 'country';
|
||||
query = buildQueryObject({
|
||||
datasource: '5__table',
|
||||
@@ -166,7 +166,7 @@ describe('buildQueryObject', () => {
|
||||
expect(query.series_limit_metric).toEqual(metric);
|
||||
});
|
||||
|
||||
it('should build series_limit_metric as undefined when empty array', () => {
|
||||
test('should build series_limit_metric as undefined when empty array', () => {
|
||||
const metric: any = [];
|
||||
query = buildQueryObject({
|
||||
datasource: '5__table',
|
||||
@@ -177,7 +177,7 @@ describe('buildQueryObject', () => {
|
||||
expect(query.series_limit_metric).toEqual(undefined);
|
||||
});
|
||||
|
||||
it('should handle null and non-numeric row_limit and row_offset', () => {
|
||||
test('should handle null and non-numeric row_limit and row_offset', () => {
|
||||
const baseQuery = {
|
||||
datasource: '5__table',
|
||||
granularity_sqla: 'ds',
|
||||
@@ -222,7 +222,7 @@ describe('buildQueryObject', () => {
|
||||
expect(query.row_offset).toBeUndefined();
|
||||
});
|
||||
|
||||
it('should populate annotation_layers', () => {
|
||||
test('should populate annotation_layers', () => {
|
||||
const annotationLayers: AnnotationLayer[] = [
|
||||
{
|
||||
annotationType: AnnotationType.Formula,
|
||||
@@ -274,7 +274,7 @@ describe('buildQueryObject', () => {
|
||||
expect(query.annotation_layers).toEqual(annotationLayers);
|
||||
});
|
||||
|
||||
it('should populate url_params', () => {
|
||||
test('should populate url_params', () => {
|
||||
expect(
|
||||
buildQueryObject({
|
||||
datasource: '5__table',
|
||||
@@ -294,7 +294,7 @@ describe('buildQueryObject', () => {
|
||||
).toBeUndefined();
|
||||
});
|
||||
|
||||
it('should populate granularity', () => {
|
||||
test('should populate granularity', () => {
|
||||
const granularity = 'ds';
|
||||
query = buildQueryObject({
|
||||
datasource: '5__table',
|
||||
@@ -304,7 +304,7 @@ describe('buildQueryObject', () => {
|
||||
expect(query.granularity).toEqual(granularity);
|
||||
});
|
||||
|
||||
it('should populate granularity from legacy field', () => {
|
||||
test('should populate granularity from legacy field', () => {
|
||||
const granularity = 'ds';
|
||||
query = buildQueryObject({
|
||||
datasource: '5__table',
|
||||
@@ -314,7 +314,7 @@ describe('buildQueryObject', () => {
|
||||
expect(query.granularity).toEqual(granularity);
|
||||
});
|
||||
|
||||
it('should populate custom_params', () => {
|
||||
test('should populate custom_params', () => {
|
||||
const customParams: JsonObject = {
|
||||
customObject: { id: 137, name: 'C-137' },
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user