Skip to content

Commit

Permalink
refactor(Cascader): test improve
Browse files Browse the repository at this point in the history
  • Loading branch information
eternalsky committed Jan 31, 2024
1 parent 1e4fdce commit ea76e22
Show file tree
Hide file tree
Showing 4 changed files with 453 additions and 529 deletions.
20 changes: 2 additions & 18 deletions components/cascader/__tests__/a11y-spec.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import React from 'react';
import Enzyme from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import Cascader from '../index';
import '../style';
import { unmount, testReact, mountReact } from '../../util/__tests__/legacy/a11y/validate';

Enzyme.configure({ adapter: new Adapter() });
import { testReact } from '../../util/__tests__/a11y/validate';

const ChinaArea = [
{
Expand Down Expand Up @@ -36,22 +32,10 @@ const ChinaArea = [
},
];

/* eslint-disable no-undef, react/jsx-filename-extension */
describe('Cascader A11y', () => {
let wrapper;

afterEach(() => {
if (wrapper) {
wrapper.unmount();
wrapper = null;
}
unmount();
});

it('should not have any violations when expanded', async () => {
wrapper = await testReact(
await testReact(
<Cascader dataSource={ChinaArea} defaultExpandedValue={['2973', '2974', '2975']} />
);
return wrapper;
});
});
Loading

0 comments on commit ea76e22

Please sign in to comment.