Skip to content

Commit

Permalink
[charts] Performance tests: set license on setup. Update vitest minor…
Browse files Browse the repository at this point in the history
… version. (#16525)

Co-authored-by: Jose C Quintas Jr <[email protected]>
  • Loading branch information
bernardobelchior and JCQuintas authored Feb 11, 2025
1 parent 3262a7a commit 50933fe
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 100 deletions.
87 changes: 22 additions & 65 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions test/performance-charts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"@testing-library/user-event": "^14.6.1",
"@vitejs/plugin-react": "^4.3.4",
"@vitejs/plugin-react-swc": "^3.7.2",
"@vitest/browser": "3.0.4",
"@vitest/ui": "3.0.4",
"@vitest/browser": "3.0.5",
"@vitest/ui": "3.0.5",
"jsdom": "^25.0.1",
"react": "^19.0.0",
"react-dom": "^19.0.0",
Expand Down
14 changes: 14 additions & 0 deletions test/performance-charts/setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { beforeAll } from 'vitest';
import { generateLicense, LicenseInfo } from '@mui/x-license';

beforeAll(() => {
const licenseKey = generateLicense({
expiryDate: new Date(3001, 0, 0, 0, 0, 0, 0),
orderNumber: 'MUI-123',
planScope: 'pro',
licenseModel: 'subscription',
planVersion: 'Q3-2024',
});

LicenseInfo.setLicenseKey(licenseKey);
});
11 changes: 0 additions & 11 deletions test/performance-charts/tests/BarChartPro.bench.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import * as React from 'react';
import { render, cleanup } from '@testing-library/react';
import { bench, describe } from 'vitest';
import { BarChartPro } from '@mui/x-charts-pro/BarChartPro';
import { LicenseInfo, generateLicense } from '@mui/x-license';
import { options } from '../utils/options';

describe('BarChartPro', () => {
Expand All @@ -19,16 +18,6 @@ describe('BarChartPro', () => {
bench(
'BarChartPro with big data amount',
async () => {
const licenseKey = generateLicense({
expiryDate: new Date(3001, 0, 0, 0, 0, 0, 0),
orderNumber: 'MUI-123',
planScope: 'pro',
licenseModel: 'subscription',
planVersion: 'Q3-2024',
});

LicenseInfo.setLicenseKey(licenseKey);

const { findByText } = render(
<BarChartPro
xAxis={[{ id: 'x', scaleType: 'band', data: xData, zoom: { filterMode: 'discard' } }]}
Expand Down
11 changes: 0 additions & 11 deletions test/performance-charts/tests/LineChartPro.bench.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import * as React from 'react';
import { render, cleanup } from '@testing-library/react';
import { bench, describe } from 'vitest';
import { LineChartPro } from '@mui/x-charts-pro/LineChartPro';
import { LicenseInfo, generateLicense } from '@mui/x-license';
import { options } from '../utils/options';

describe('LineChartPro', () => {
Expand All @@ -19,16 +18,6 @@ describe('LineChartPro', () => {
bench(
'LineChartPro with big data amount',
async () => {
const licenseKey = generateLicense({
expiryDate: new Date(3001, 0, 0, 0, 0, 0, 0),
orderNumber: 'MUI-123',
planScope: 'pro',
licenseModel: 'subscription',
planVersion: 'Q3-2024',
});

LicenseInfo.setLicenseKey(licenseKey);

const { findByText } = render(
<LineChartPro
xAxis={[{ id: 'x', data: xData, zoom: { filterMode: 'discard' } }]}
Expand Down
11 changes: 0 additions & 11 deletions test/performance-charts/tests/ScatterChartPro.bench.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import * as React from 'react';
import { render, cleanup } from '@testing-library/react';
import { bench, describe } from 'vitest';
import { ScatterChartPro } from '@mui/x-charts-pro/ScatterChartPro';
import { LicenseInfo, generateLicense } from '@mui/x-license';
import { options } from '../utils/options';

describe('ScatterChartPro', () => {
Expand All @@ -18,16 +17,6 @@ describe('ScatterChartPro', () => {
bench(
'ScatterChartPro with big data amount',
async () => {
const licenseKey = generateLicense({
expiryDate: new Date(3001, 0, 0, 0, 0, 0, 0),
orderNumber: 'MUI-123',
planScope: 'pro',
licenseModel: 'subscription',
planVersion: 'Q3-2024',
});

LicenseInfo.setLicenseKey(licenseKey);

const { findByText } = render(
<ScatterChartPro
xAxis={[
Expand Down
1 change: 1 addition & 0 deletions test/performance-charts/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import react from '@vitejs/plugin-react';
export default defineConfig({
plugins: [codspeedPlugin(), react()],
test: {
setupFiles: ['./setup.ts'],
environment: 'jsdom',
// browser: {
// enabled: true,
Expand Down

0 comments on commit 50933fe

Please sign in to comment.