mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
test(frontend): Migrate from describe/it to flat test() pattern (#35305)
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -25,6 +25,7 @@ import {
|
||||
} from './valueCalculations';
|
||||
import type { ColumnConfig, Entry } from '../../types';
|
||||
|
||||
// eslint-disable-next-line no-restricted-globals -- TODO: Migrate from describe blocks
|
||||
describe('valueCalculations', () => {
|
||||
const mockEntries: Entry[] = [
|
||||
{ time: '2023-01-03', sales: 300, price: 30 },
|
||||
@@ -32,6 +33,7 @@ describe('valueCalculations', () => {
|
||||
{ time: '2023-01-01', sales: 100, price: 10 },
|
||||
];
|
||||
|
||||
// eslint-disable-next-line no-restricted-globals -- TODO: Migrate from describe blocks
|
||||
describe('calculateTimeValue', () => {
|
||||
test('should calculate diff comparison correctly', () => {
|
||||
const column: ColumnConfig = {
|
||||
@@ -125,6 +127,7 @@ describe('valueCalculations', () => {
|
||||
});
|
||||
});
|
||||
|
||||
// eslint-disable-next-line no-restricted-globals -- TODO: Migrate from describe blocks
|
||||
describe('calculateContribution', () => {
|
||||
test('should calculate contribution correctly', () => {
|
||||
const result = calculateContribution(300, mockEntries);
|
||||
@@ -152,6 +155,7 @@ describe('valueCalculations', () => {
|
||||
});
|
||||
});
|
||||
|
||||
// eslint-disable-next-line no-restricted-globals -- TODO: Migrate from describe blocks
|
||||
describe('calculateAverage', () => {
|
||||
test('should calculate average correctly', () => {
|
||||
const column: ColumnConfig = {
|
||||
@@ -213,6 +217,7 @@ describe('valueCalculations', () => {
|
||||
});
|
||||
});
|
||||
|
||||
// eslint-disable-next-line no-restricted-globals -- TODO: Migrate from describe blocks
|
||||
describe('calculateCellValue', () => {
|
||||
test('should route to time calculation', () => {
|
||||
const column: ColumnConfig = {
|
||||
|
||||
Reference in New Issue
Block a user