Skip to content

Commit

Permalink
Source Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
bryceosterhaus committed Feb 8, 2017
1 parent 1d40808 commit eeefc04
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 50 deletions.
29 changes: 14 additions & 15 deletions frontend/components/__tests__/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ const fooRoot = {
id: 'foo'
};


describe('App', () => {
it('should render', () => {
test('should render', () => {
const component = new App({
port: {
onMessage: {
Expand All @@ -25,7 +24,7 @@ describe('App', () => {
expect(snap(component)).toMatchSnapshot();
});

it('should add root to state', () => {
test('should add root to state', () => {
const component = new App({
port: {
onMessage: {
Expand All @@ -40,7 +39,7 @@ describe('App', () => {
expect(component.state.rootComponents).toEqual({foo: fooRoot});
});

it('should check id detached component is a root', () => {
test('should check id detached component is a root', () => {
const component = new App({
port: {
onMessage: {
Expand All @@ -55,7 +54,7 @@ describe('App', () => {
expect(component.state.rootComponents).toEqual({});
});

it('should set column width', () => {
test('should set column width', () => {
const component = new App({
port: {
onMessage: {
Expand All @@ -70,7 +69,7 @@ describe('App', () => {
});

describe('processMessage', () => {
it('should call `checkIfRootDetached`', () => {
test('should call `checkIfRootDetached`', () => {
const component = new App({
port: {
onMessage: {
Expand All @@ -88,7 +87,7 @@ describe('App', () => {
expect(spy).toBeCalled();
});

it('should call `updateRootComponent`', () => {
test('should call `updateRootComponent`', () => {
const component = new App({
port: {
onMessage: {
Expand All @@ -106,7 +105,7 @@ describe('App', () => {
expect(spy).toBeCalled();
});

it('should set selectedComponent', () => {
test('should set selectedComponent', () => {
const component = new App({
port: {
onMessage: {
Expand All @@ -120,7 +119,7 @@ describe('App', () => {
expect(component.state.selectedComponent).toBe(fooRoot);
});

it('should call `addRootComponent`', () => {
test('should call `addRootComponent`', () => {
const component = new App({
port: {
onMessage: {
Expand All @@ -138,7 +137,7 @@ describe('App', () => {
expect(spy).toBeCalled();
});

it('should emit console.log', () => {
test('should emit console.log', () => {
const component = new App({
port: {
onMessage: {
Expand All @@ -159,7 +158,7 @@ describe('App', () => {
});
});

it('should emit console.log', () => {
test('should emit console.log', () => {
const component = new App({
port: {
onMessage: {
Expand All @@ -177,7 +176,7 @@ describe('App', () => {
expect(spy).toBeCalled();
});

it('should reset rootComponents state', () => {
test('should reset rootComponents state', () => {
const component = new App({
port: {
onMessage: {
Expand All @@ -193,7 +192,7 @@ describe('App', () => {
expect(component.state.rootComponents).toEqual({});
});

it('should update component', () => {
test('should update component', () => {
const component = new App({
port: {
onMessage: {
Expand All @@ -209,7 +208,7 @@ describe('App', () => {
expect(component.state.rootComponents['foo'].name).toEqual('fooRoot');
});

it('should add/remove `flash` class', () => {
test('should add/remove `flash` class', () => {
const component = new App({
port: {
onMessage: {
Expand All @@ -227,7 +226,7 @@ describe('App', () => {
expect(component.element.classList).not.toContain('flash');
});

it('should add/remove `flash` class', () => {
test('should add/remove `flash` class', () => {
const component = new App({
element: document.getElementById('testComponent'),
port: {
Expand Down
10 changes: 5 additions & 5 deletions frontend/components/__tests__/FlashStateValue.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ jest.unmock('../../lib/processStateValues');
import FlashStateValue from '../FlashStateValue';

describe('FlashStateValue', () => {
it('should render', () => {
test('should render', () => {
const component = new FlashStateValue();

expect(snap(component)).toMatchSnapshot();
});

it('should add `flash` class', () => {
test('should add `flash` class', () => {
const component = new FlashStateValue();

const spy = jest.fn();
Expand All @@ -23,7 +23,7 @@ describe('FlashStateValue', () => {
expect(spy).toBeCalled();
});

it('should remove `flash` class', () => {
test('should remove `flash` class', () => {
const component = new FlashStateValue();

component.element.classList.add('flash');
Expand All @@ -35,7 +35,7 @@ describe('FlashStateValue', () => {
expect(component.element.classList).not.toContain('flash');
});

it('should call addFlash if it is not the firstRender', () => {
test('should call addFlash if it is not the firstRender', () => {
const component = new FlashStateValue();

const spy = jest.fn();
Expand All @@ -49,7 +49,7 @@ describe('FlashStateValue', () => {
expect(spy).toBeCalled();
});

it('should set _firstRender to false', () => {
test('should set _firstRender to false', () => {
const component = new FlashStateValue();

component.syncValue(0, 1);
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/__tests__/InitialWarning.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ jest.unmock('../InitialWarning');
import InitialWarning from '../InitialWarning';

describe('InitialWarning', () => {
it('should render', () => {
test('should render', () => {
const component = new InitialWarning();

expect(snap(component)).toMatchSnapshot();
Expand Down
6 changes: 3 additions & 3 deletions frontend/components/__tests__/NodeName.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ jest.unmock('../NodeName');
import NodeName, {OPENING, NORMAL_CLOSING, SELF_CLOSING} from '../NodeName';

describe('NodeName', () => {
it('should render with OPENING', () => {
test('should render with OPENING', () => {
const component = new NodeName({type: OPENING});

expect(snap(component)).toMatchSnapshot();
});

it('should render with NORMAL_CLOSING', () => {
test('should render with NORMAL_CLOSING', () => {
const component = new NodeName({type: NORMAL_CLOSING});

expect(snap(component)).toMatchSnapshot();
});

it('should render with SELF_CLOSING', () => {
test('should render with SELF_CLOSING', () => {
const component = new NodeName({type: SELF_CLOSING});

expect(snap(component)).toMatchSnapshot();
Expand Down
8 changes: 4 additions & 4 deletions frontend/components/__tests__/ResizeDivider.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ jest.unmock('../ResizeDivider');
import ResizeDivider from '../ResizeDivider';

describe('ResizeDivider', () => {
it('should render', () => {
test('should render', () => {
const component = new ResizeDivider({onResize: jest.fn()});

expect(snap(component)).toMatchSnapshot();
});

it('should call onResize prop with specific arg', () => {
test('should call onResize prop with specific arg', () => {
const spy = jest.fn();
const component = new ResizeDivider({onResize: spy});

Expand All @@ -20,7 +20,7 @@ describe('ResizeDivider', () => {
expect(spy).toBeCalledWith(arg);
});

it('should add event listeners on body', () => {
test('should add event listeners on body', () => {
const spy = jest.fn();

document.body.addEventListener = spy;
Expand All @@ -34,7 +34,7 @@ describe('ResizeDivider', () => {
document.body.addEventListener.mockClear();
});

it('should remove event listeners on body', () => {
test('should remove event listeners on body', () => {
const spy = jest.fn();

document.body.removeEventListener = spy;
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/__tests__/StatePane.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jest.unmock('../FlashStateValue');
import StatePane from '../StatePane';

describe('StatePane', () => {
it('should render', () => {
test('should render', () => {
const component = new StatePane(
{
component: {
Expand All @@ -24,7 +24,7 @@ describe('StatePane', () => {
expect(snap(component)).toMatchSnapshot();
});

it('should call onInspectDOM prop', () => {
test('should call onInspectDOM prop', () => {
const id = 'foo';
const spy = jest.fn();

Expand Down
24 changes: 12 additions & 12 deletions frontend/components/__tests__/TreeNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const eventObj = {
};

describe('TreeNode', () => {
it('should render', () => {
test('should render', () => {
const component = new TreeNode(
{
componentNode: {
Expand All @@ -21,7 +21,7 @@ describe('TreeNode', () => {
expect(snap(component)).toMatchSnapshot();
});

it('should show when expanded', () => {
test('should show when expanded', () => {
const component = new TreeNode(
{
componentNode: {
Expand All @@ -35,7 +35,7 @@ describe('TreeNode', () => {
expect(snap(component)).toMatchSnapshot();
});

it('should show when highlighted', () => {
test('should show when highlighted', () => {
const component = new TreeNode(
{
componentNode: {
Expand All @@ -49,7 +49,7 @@ describe('TreeNode', () => {
expect(snap(component)).toMatchSnapshot();
});

it('should set showMenu to false', () => {
test('should set showMenu to false', () => {
const component = new TreeNode();

component.state.showMenu = true;
Expand All @@ -63,7 +63,7 @@ describe('TreeNode', () => {
expect(component.state.showMenu).toBe(false);
});

it('should call onNodeSelect prop', () => {
test('should call onNodeSelect prop', () => {
const spy = jest.fn();

const component = new TreeNode({
Expand All @@ -75,7 +75,7 @@ describe('TreeNode', () => {
expect(spy).toBeCalled();
});

it('should set showMenu to true', () => {
test('should set showMenu to true', () => {
const component = new TreeNode();

expect(component.state.showMenu).toBe(false);
Expand All @@ -85,7 +85,7 @@ describe('TreeNode', () => {
expect(component.state.showMenu).toBe(true);
});

it('should call onInspectDOM prop', () => {
test('should call onInspectDOM prop', () => {
const spy = jest.fn();

const component = new TreeNode({
Expand All @@ -97,7 +97,7 @@ describe('TreeNode', () => {
expect(spy).toBeCalled();
});

it('should toggle expanded and call onNodeSelect prop', () => {
test('should toggle expanded and call onNodeSelect prop', () => {
const spy = jest.fn();

const component = new TreeNode({
Expand All @@ -113,7 +113,7 @@ describe('TreeNode', () => {
expect(spy).toHaveBeenCalledTimes(2);
});

it('should call highlightDOM prop and set highlight value', () => {
test('should call highlightDOM prop and set highlight value', () => {
const spy = jest.fn();

const component = new TreeNode({
Expand All @@ -129,7 +129,7 @@ describe('TreeNode', () => {
expect(spy).toHaveBeenCalledTimes(2);
});

it('should call toggleHighlight with true', () => {
test('should call toggleHighlight with true', () => {
const component = new TreeNode();

component.toggleHighlight = jest.fn();
Expand All @@ -139,7 +139,7 @@ describe('TreeNode', () => {
expect(component.toggleHighlight).toBeCalledWith(true);
});

it('should call toggleHighlight with false', () => {
test('should call toggleHighlight with false', () => {
const component = new TreeNode();

component.toggleHighlight = jest.fn();
Expand All @@ -149,7 +149,7 @@ describe('TreeNode', () => {
expect(component.toggleHighlight).toBeCalledWith(false);
});

it('should call highlightDOM prop and set highlight value', () => {
test('should call highlightDOM prop and set highlight value', () => {
const id = 'foo';

const div = document.createElement('div');
Expand Down
4 changes: 2 additions & 2 deletions frontend/lib/__tests__/otherProps.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import otherProps from '../otherProps';
describe(
'otherProps',
() => {
it(
test(
'should return all config props not declared in STATE',
() => {
class TestComponent extends Component {
Expand Down Expand Up @@ -38,7 +38,7 @@ describe(
}
);

it(
test(
'should ignore children',
() => {
class TestComponent extends Component {
Expand Down
Loading

0 comments on commit eeefc04

Please sign in to comment.