-
Notifications
You must be signed in to change notification settings - Fork 836
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add eslint-plugin-jest and rename all test files as *.test.js (#1339)
* Add eslint-plugin-jest and enforce recommended rules * Add top-level describe block to all tests and enforce related lint rule * Remove eslint-plugin-no-only-tests * Rename all test files as *.test.js * fixup! Remove eslint-plugin-no-only-tests * Drop node 8 test in CI
- Loading branch information
Showing
95 changed files
with
4,055 additions
and
3,896 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
language: node_js | ||
node_js: | ||
- '8' | ||
- '10' | ||
script: | ||
- npm run lint | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import React from 'react'; | ||
import {mount} from 'enzyme'; | ||
import ArcSeries from 'plot/series/arc-series'; | ||
import {testRenderWithProps, GENERIC_XYPLOT_SERIES_PROPS} from '../test-utils'; | ||
import ArcSeriesExample from '../../../showcase/radial-chart/arc-series-example'; | ||
|
||
testRenderWithProps(ArcSeries, GENERIC_XYPLOT_SERIES_PROPS); | ||
|
||
describe('ArcSeries', () => { | ||
test('Showcase Example - ArcSeriesExample', () => { | ||
const $ = mount(<ArcSeriesExample />); | ||
expect($.text()).toBe('UPDATE-4-2024-4-2024'); | ||
// multiplied by two to account for shadow listeners | ||
expect($.find('.rv-xy-plot__series--arc').length).toBe(4); | ||
expect($.find('.rv-xy-plot__series--arc path').length).toBe(2 * 8); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import React from 'react'; | ||
import {mount} from 'enzyme'; | ||
|
||
import XYPlot from 'plot/xy-plot'; | ||
import AreaSeries from 'plot/series/area-series'; | ||
import {testRenderWithProps, GENERIC_XYPLOT_SERIES_PROPS} from '../test-utils'; | ||
import AreaChartElevated from '../../../showcase/plot/area-chart-elevated'; | ||
import AreaChart from '../../../showcase/plot/area-chart'; | ||
|
||
testRenderWithProps(AreaSeries, GENERIC_XYPLOT_SERIES_PROPS); | ||
|
||
const AREA_PROPS = { | ||
className: 'area-chart-example', | ||
color: '#12939a', | ||
data: [ | ||
{x: 1, y: 5, y0: 6}, | ||
{x: 2, y: 20, y0: 11}, | ||
{x: 3, y: 10, y0: 9} | ||
] | ||
}; | ||
|
||
describe('AreaSeries', () => { | ||
test('basic rendering', () => { | ||
const $ = mount( | ||
<XYPlot width={300} height={300}> | ||
<AreaSeries {...AREA_PROPS} /> | ||
</XYPlot> | ||
); | ||
expect($.find('.rv-xy-plot__series').length).toBe(1); | ||
expect($.find('path.rv-xy-plot__series').length).toBe(1); | ||
expect($.find('path.area-chart-example').length).toBe(1); | ||
|
||
$.setProps({children: <AreaSeries {...{...AREA_PROPS, data: null}} />}); | ||
expect($.find('.rv-xy-plot__series').length).toBe(0); | ||
expect($.find('.rv-xy-plot__series path').length).toBe(0); | ||
expect($.find('.area-chart-example').length).toBe(0); | ||
}); | ||
|
||
test('AreaSeries: Showcase Example - AreaChart', () => { | ||
const $ = mount(<AreaChart />); | ||
expect($.find('.rv-xy-plot__series').length).toBe(1); | ||
expect($.find('path.rv-xy-plot__series').length).toBe(1); | ||
expect($.find('path.area-series-example').length).toBe(1); | ||
}); | ||
|
||
test('AreaSeries: Showcase Example - AreaChartElevated', () => { | ||
const $ = mount(<AreaChartElevated />); | ||
expect($.find('.rv-xy-plot__series').length).toBe(5); | ||
expect($.find('path.rv-xy-plot__series').length).toBe(3); | ||
expect($.find('path.area-elevated-series-1').length).toBe(1); | ||
expect($.find('path.area-elevated-series-2').length).toBe(1); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.