mirror of
https://github.com/apache/superset.git
synced 2026-04-20 00:24:38 +00:00
chore: replace Lodash usage with native JS implementation (#31907)
Signed-off-by: hainenber <dotronghai96@gmail.com>
This commit is contained in:
@@ -24,7 +24,6 @@ import { render, screen } from 'spec/helpers/testing-library';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
import { UploadFile } from 'antd/lib/upload/interface';
|
||||
import { forEach } from 'lodash';
|
||||
|
||||
fetchMock.post('glob:*api/v1/database/1/csv_upload/', {});
|
||||
fetchMock.post('glob:*api/v1/database/1/excel_upload/', {});
|
||||
@@ -782,7 +781,7 @@ test('Columnar, form post', async () => {
|
||||
|
||||
test('CSV, validate file extension returns false', () => {
|
||||
const invalidFileNames = ['out', 'out.exe', 'out.csv.exe', '.csv', 'out.xls'];
|
||||
forEach(invalidFileNames, fileName => {
|
||||
invalidFileNames.forEach(fileName => {
|
||||
const file: UploadFile<any> = {
|
||||
name: fileName,
|
||||
uid: 'xp',
|
||||
@@ -795,7 +794,7 @@ test('CSV, validate file extension returns false', () => {
|
||||
|
||||
test('Excel, validate file extension returns false', () => {
|
||||
const invalidFileNames = ['out', 'out.exe', 'out.xls.exe', '.csv', 'out.csv'];
|
||||
forEach(invalidFileNames, fileName => {
|
||||
invalidFileNames.forEach(fileName => {
|
||||
const file: UploadFile<any> = {
|
||||
name: fileName,
|
||||
uid: 'xp',
|
||||
@@ -814,7 +813,7 @@ test('Columnar, validate file extension returns false', () => {
|
||||
'.parquet',
|
||||
'out.excel',
|
||||
];
|
||||
forEach(invalidFileNames, fileName => {
|
||||
invalidFileNames.forEach(fileName => {
|
||||
const file: UploadFile<any> = {
|
||||
name: fileName,
|
||||
uid: 'xp',
|
||||
@@ -827,7 +826,7 @@ test('Columnar, validate file extension returns false', () => {
|
||||
|
||||
test('CSV, validate file extension returns true', () => {
|
||||
const invalidFileNames = ['out.csv', 'out.tsv', 'out.exe.csv', 'out a.csv'];
|
||||
forEach(invalidFileNames, fileName => {
|
||||
invalidFileNames.forEach(fileName => {
|
||||
const file: UploadFile<any> = {
|
||||
name: fileName,
|
||||
uid: 'xp',
|
||||
@@ -840,7 +839,7 @@ test('CSV, validate file extension returns true', () => {
|
||||
|
||||
test('Excel, validate file extension returns true', () => {
|
||||
const invalidFileNames = ['out.xls', 'out.xlsx', 'out.exe.xls', 'out a.xls'];
|
||||
forEach(invalidFileNames, fileName => {
|
||||
invalidFileNames.forEach(fileName => {
|
||||
const file: UploadFile<any> = {
|
||||
name: fileName,
|
||||
uid: 'xp',
|
||||
@@ -858,7 +857,7 @@ test('Columnar, validate file extension returns true', () => {
|
||||
'out.exe.zip',
|
||||
'out a.parquet',
|
||||
];
|
||||
forEach(invalidFileNames, fileName => {
|
||||
invalidFileNames.forEach(fileName => {
|
||||
const file: UploadFile<any> = {
|
||||
name: fileName,
|
||||
uid: 'xp',
|
||||
|
||||
Reference in New Issue
Block a user