diff --git a/.eslintrc.js b/.eslintrc.js index d9ec7523..36bad06b 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -17,6 +17,7 @@ module.exports = { 'prefer-destructuring': 0, 'react/no-unused-prop-types': 0, 'max-len': 0, - 'brace-style': 0, + "import/no-extraneous-dependencies": ["error", {"devDependencies": true, "optionalDependencies": false, "peerDependencies": false}], + 'brace-style': 0 }, }; diff --git a/package.json b/package.json index 2dbc46e5..61af744f 100644 --- a/package.json +++ b/package.json @@ -41,12 +41,15 @@ "prepublishOnly": "npm run lint && npm run test && npm run compile && np --no-cleanup --yolo --no-publish" }, "devDependencies": { + "@umijs/fabric": "^2.0.4", "coveralls": "^3.0.6", "cross-env": "^7.0.2", "enzyme": "^3.7.0", "enzyme-adapter-react-16": "^1.7.0", "enzyme-to-json": "^3.3.4", + "eslint": "^6.8.0", "fastclick": "~1.0.6", + "father": "^2.29.2", "history": "^1.17.0", "immutability-helper": "^3.0.1", "less-loader": "^5.0.0", @@ -54,14 +57,12 @@ "preact": "^8.2.1", "preact-compat": "^3.16.0", "react": "^16.0.0", - "react-dom": "^16.0.0", "react-dnd": "^7.0.2", "react-dnd-html5-backend": "^7.0.2", + "react-dom": "^16.0.0", "react-router": "^3.0.0", "react-test-renderer": "^16.0.0", - "sortablejs": "^1.7.0", - "father": "^2.29.2", - "@umijs/fabric": "^2.0.4" + "sortablejs": "^1.7.0" }, "dependencies": { "classnames": "2.x", diff --git a/tests/__snapshots__/a11y.spec.js.snap b/tests/__snapshots__/a11y.spec.js.snap index 6af300f4..d1273d05 100644 --- a/tests/__snapshots__/a11y.spec.js.snap +++ b/tests/__snapshots__/a11y.spec.js.snap @@ -12,6 +12,10 @@ exports[` should render correctly 1`] = ` role="tablist" tabindex="-1" > +
@@ -172,6 +176,10 @@ exports[` should render correctly 1`] = ` role="tablist" tabindex="-1" > +
@@ -343,6 +351,10 @@ exports[` should render correctly 1`] = role="tablist" tabindex="-1" > +
diff --git a/tests/a11y.spec.js b/tests/a11y.spec.js index 8839f7d9..e3428503 100644 --- a/tests/a11y.spec.js +++ b/tests/a11y.spec.js @@ -60,6 +60,15 @@ describe('', () => { expect(renderToJson(render(component))).toMatchSnapshot(); }); + it('extraContent not listen keyboard naviagtion', () => { + wrapper.find('#input').simulate('keyDown', { + keyCode: KeyCode.RIGHT, + which: KeyCode.RIGHT, + }); + expect(tabs.at(0).getDOMNode().className).toContain('rc-tabs-tab-active'); + expect(tabs.at(1).getDOMNode().className).not.toContain('rc-tabs-tab-active'); + }); + it('first tab should be selected by default', () => { const firstTab = tabs.first(); const selectedTab = tabs.find('[aria-selected="true"]'); @@ -77,15 +86,6 @@ describe('', () => { thirdTab.simulate('click'); expect(document.activeElement).toBe(thirdTab.getDOMNode()); }); - - it('extraContent not listen keyboard naviagtion', () => { - wrapper.find('#input').simulate('keyDown', { - keyCode: KeyCode.RIGHT, - which: KeyCode.RIGHT, - }); - expect(tabs.at(0).getDOMNode().className).toContain('rc-tabs-tab-active'); - expect(tabs.at(1).getDOMNode().className).not.toContain('rc-tabs-tab-active'); - }); }); describe('', () => {