Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mayurnewase committed Sep 17, 2022
1 parent c24bb63 commit e4cf266
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
3 changes: 3 additions & 0 deletions superset-frontend/plugins/plugin-chart-table/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
"regenerator-runtime": "^0.13.7",
"xss": "^1.0.10"
},
"devDependencies": {
"@testing-library/react": "^11.2.0"
},
"peerDependencies": {
"@types/react": "*",
"@superset-ui/chart-controls": "*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
*/
import React from 'react';
import { CommonWrapper } from 'enzyme';
import { render, screen } from '@testing-library/react';
import TableChart from '../src/TableChart';
import transformProps from '../src/transformProps';
import DateWithFormatter from '../src/utils/DateWithFormatter';
import testData from './testData';
import { mount, ProviderWrapper } from './enzyme';
import { render, screen } from '@testing-library/react';

describe('plugin-chart-table', () => {
describe('transformProps', () => {
Expand Down Expand Up @@ -107,7 +107,7 @@ describe('plugin-chart-table', () => {
expect(tree.text()).toContain('No records found');
});

it('render color with column color formatter', async () => {
it('render color with column color formatter', () => {
render(
ProviderWrapper({
children: (
Expand All @@ -131,15 +131,13 @@ describe('plugin-chart-table', () => {
}),
);

expect(
getComputedStyle(await screen.getByTitle('2467063')).background,
).toBe('rgba(172, 225, 196, 1)');
expect(getComputedStyle(await screen.getByTitle('2467')).background).toBe(
'',
expect(getComputedStyle(screen.getByTitle('2467063')).background).toBe(
'rgba(172, 225, 196, 1)',
);
expect(getComputedStyle(screen.getByTitle('2467')).background).toBe('');
});

it('render cell without color', async () => {
it('render cell without color', () => {
const dataWithEmptyCell = testData.advanced.queriesData[0];
dataWithEmptyCell.data.push({
__timestamp: null,
Expand Down Expand Up @@ -172,15 +170,13 @@ describe('plugin-chart-table', () => {
),
}),
);
expect(getComputedStyle(await screen.getByTitle('2467')).background).toBe(
expect(getComputedStyle(screen.getByTitle('2467')).background).toBe(
'rgba(172, 225, 196, 0.812)',
);
expect(
getComputedStyle(await screen.getByTitle('2467063')).background,
).toBe('');
expect(getComputedStyle(await screen.getByText('N/A')).background).toBe(
expect(getComputedStyle(screen.getByTitle('2467063')).background).toBe(
'',
);
expect(getComputedStyle(screen.getByText('N/A')).background).toBe('');
});
});
});

0 comments on commit e4cf266

Please sign in to comment.