Skip to content

Commit 4fc7c40

Browse files
committed
Simple eslint fixes
1 parent db3101c commit 4fc7c40

File tree

4 files changed

+48
-48
lines changed

4 files changed

+48
-48
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"src/index.d.ts"
2020
],
2121
"scripts": {
22-
"lint": "eslint ./src ./examples",
22+
"lint": "eslint ./src ./tests ./examples",
2323
"test": "yarn lint && yarn test:only",
2424
"test:only": "jest --no-cache --verbose --coverage",
2525
"test:dev": "jest --watchAll --no-cache --verbose --coverage",

tests/actions.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ let eventObj = {};
66

77
describe('actions test', () => {
88
beforeAll(() => {
9-
showCallback = jest.fn(e => {
9+
showCallback = jest.fn((e) => {
1010
eventObj = e;
1111
});
1212
window.addEventListener(MENU_SHOW, showCallback);
1313

14-
hideCallback = jest.fn(e => {
14+
hideCallback = jest.fn((e) => {
1515
eventObj = e;
1616
});
1717
window.addEventListener(MENU_HIDE, hideCallback);

tests/sub-menu-test.js

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,51 @@
1-
"use strict";
21

3-
import React from "react";
4-
import { shallow, mount } from "enzyme";
5-
import { expect } from "chai";
62

7-
import SubMenu from "../src/submenu";
3+
import React from 'react';
4+
import { shallow, mount } from 'enzyme';
5+
import { expect } from 'chai';
86

9-
describe("<SubMenu/>", () => {
10-
it("should have `react-context-menu-item` & `submenu` classes", () => {
11-
const wrapper = shallow(<SubMenu title="foo"/>);
7+
import SubMenu from '../src/submenu';
128

13-
expect(wrapper).to.have.className("react-context-menu-item");
14-
expect(wrapper).to.have.className("submenu");
9+
describe('<SubMenu/>', () => {
10+
it('should have `react-context-menu-item` & `submenu` classes', () => {
11+
const wrapper = shallow(<SubMenu title='foo' />);
12+
13+
expect(wrapper).to.have.className('react-context-menu-item');
14+
expect(wrapper).to.have.className('submenu');
1515
});
1616

17-
it("<a/> should have `react-context-menu-link` class", () => {
18-
const wrapper = shallow(<SubMenu title="foo"/>);
17+
it('<a/> should have `react-context-menu-link` class', () => {
18+
const wrapper = shallow(<SubMenu title='foo' />);
1919

20-
expect(wrapper.find("a")).to.have.className("react-context-menu-link");
21-
expect(wrapper.find("a")).to.not.have.className("disabled");
20+
expect(wrapper.find('a')).to.have.className('react-context-menu-link');
21+
expect(wrapper.find('a')).to.not.have.className('disabled');
2222
});
2323

24-
it("<a/> should have `disabled` class when disabled", () => {
25-
const wrapper = shallow(<SubMenu title="foo" disabled/>);
24+
it('<a/> should have `disabled` class when disabled', () => {
25+
const wrapper = shallow(<SubMenu title='foo' disabled />);
2626

27-
expect(wrapper.find("a")).to.have.className("react-context-menu-link");
28-
expect(wrapper.find("a")).to.have.className("disabled");
27+
expect(wrapper.find('a')).to.have.className('react-context-menu-link');
28+
expect(wrapper.find('a')).to.have.className('disabled');
2929
});
3030

31-
it("should render `title` inside `<a/>`", () => {
32-
const title = Math.random().toString(36),
33-
wrapper = shallow(<SubMenu title={title} disabled/>);
31+
it('should render `title` inside `<a/>`', () => {
32+
const title = Math.random().toString(36);
33+
const wrapper = shallow(<SubMenu title={title} disabled />);
3434

35-
expect(wrapper.find("a")).to.have.text(title);
35+
expect(wrapper.find('a')).to.have.text(title);
3636
});
3737

38-
xit("should open submenu `onMouseEnter`", function() {
39-
const wrapper = mount(<SubMenu title="foo" hoverDelay={0}/>);
38+
xit('should open submenu `onMouseEnter`', function () {
39+
const wrapper = mount(<SubMenu title='foo' hoverDelay={0} />);
4040

41-
wrapper.find(".submenu").simulate("mouseEnter");
42-
expect(wrapper).to.have.state("visible", true);
41+
wrapper.find('.submenu').simulate('mouseEnter');
42+
expect(wrapper).to.have.state('visible', true);
4343
});
4444

45-
xit("should not open submenu `onMouseEnter` when disabled", function() {
46-
const wrapper = mount(<SubMenu title="foo" hoverDelay={0} disabled/>);
45+
xit('should not open submenu `onMouseEnter` when disabled', function () {
46+
const wrapper = mount(<SubMenu title='foo' hoverDelay={0} disabled />);
4747

48-
wrapper.simulate("mouseenter");
49-
expect(wrapper).to.have.state("visible", false);
48+
wrapper.simulate('mouseenter');
49+
expect(wrapper).to.have.state('visible', false);
5050
});
5151
});

tests/sub-menu-wrapper-test.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
"use strict";
21

3-
import React from "react";
4-
import { shallow, mount } from "enzyme";
2+
3+
import React from 'react';
4+
import { shallow, mount } from 'enzyme';
55
// import sinon from "sinon";
6-
import { expect } from "chai";
6+
import { expect } from 'chai';
77

8-
import SubMenuWrapper from "../src/submenu/wrapper";
8+
import SubMenuWrapper from '../src/submenu/wrapper';
99
// import monitor from "../src/monitor";
1010

11-
describe("<SubMenuWrapper/>", () => {
12-
it("should have `react-context-menu` class", () => {
13-
const wrapper = shallow(<SubMenuWrapper/>);
11+
describe('<SubMenuWrapper/>', () => {
12+
it('should have `react-context-menu` class', () => {
13+
const wrapper = shallow(<SubMenuWrapper />);
1414

15-
expect(wrapper.hasClass("react-context-menu")).to.equal(true);
15+
expect(wrapper.hasClass('react-context-menu')).to.equal(true);
1616
});
1717

18-
it("should be invisible by default", () => {
19-
const wrapper = mount(<SubMenuWrapper/>);
18+
it('should be invisible by default', () => {
19+
const wrapper = mount(<SubMenuWrapper />);
2020

21-
expect(wrapper.find("nav")).to.have.style("display", "none");
21+
expect(wrapper.find('nav')).to.have.style('display', 'none');
2222
});
2323

24-
it("should be visible when `visible` is passed", () => {
25-
const wrapper = mount(<SubMenuWrapper visible/>);
24+
it('should be visible when `visible` is passed', () => {
25+
const wrapper = mount(<SubMenuWrapper visible />);
2626

27-
expect(wrapper.find("nav")).to.have.style("display", "block");
27+
expect(wrapper.find('nav')).to.have.style('display', 'block');
2828
});
2929
});

0 commit comments

Comments
 (0)