Skip to content

Commit

Permalink
try license inside
Browse files Browse the repository at this point in the history
  • Loading branch information
JCQuintas committed Nov 8, 2024
1 parent 80eb078 commit 758920c
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 12 deletions.
11 changes: 11 additions & 0 deletions test/performance-charts/tests/BarChartPro.bench.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as React from 'react';
import { render, cleanup } from '@testing-library/react';
import { afterEach, 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 @@ -22,6 +23,16 @@ 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: 11 additions & 0 deletions test/performance-charts/tests/LineChartPro.bench.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as React from 'react';
import { render, cleanup } from '@testing-library/react';
import { afterEach, 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 @@ -22,6 +23,16 @@ 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: 11 additions & 0 deletions test/performance-charts/tests/ScatterChartPro.bench.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as React from 'react';
import { render, cleanup } from '@testing-library/react';
import { afterEach, 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 @@ -22,6 +23,16 @@ 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
12 changes: 0 additions & 12 deletions test/performance-charts/utils/options.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
import { BenchOptions } from 'vitest';
import { LicenseInfo, generateLicense } from '@mui/x-license';

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

const iterations = globalThis.process?.env?.BENCHMARK_ITERATIONS
? parseInt(globalThis.process.env.BENCHMARK_ITERATIONS, 10)
: 1;

export const options: BenchOptions = {
iterations,
setup: () => {
LicenseInfo.setLicenseKey(licenseKey);
},
};

0 comments on commit 758920c

Please sign in to comment.