This repository has been archived by the owner on Nov 10, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove jshint/ jsxhint and use eslint with react plugin
- Loading branch information
Showing
27 changed files
with
281 additions
and
266 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,36 @@ | ||
{ | ||
"rules": { | ||
"indent": [ | ||
2, | ||
2 | ||
], | ||
"quotes": [ | ||
2, | ||
"double" | ||
], | ||
"linebreak-style": [ | ||
2, | ||
"unix" | ||
], | ||
"semi": [ | ||
2, | ||
"always" | ||
], | ||
"no-console": [ | ||
1 | ||
] | ||
|
||
}, | ||
"env": { | ||
"browser": true, | ||
"node": true | ||
} | ||
} | ||
"node": true, | ||
"mocha": true | ||
}, | ||
"extends": "eslint:recommended", | ||
"ecmaFeatures": { | ||
"jsx": true | ||
}, | ||
"plugins": [ | ||
"react" | ||
] | ||
} |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
language: node_js | ||
node_js: | ||
- "0.10" | ||
- "4" |
This file was deleted.
Oops, something went wrong.
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
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
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,41 +1,57 @@ | ||
"use strict"; | ||
|
||
var TestUtils = require('react/addons').addons.TestUtils; | ||
|
||
jest.dontMock('../DefaultContent'); | ||
var DefaultContent = require('../DefaultContent'); | ||
|
||
describe("#render", function() { | ||
var comp; | ||
var React = require("react"); | ||
var TestUtils = require("react/lib/ReactTestUtils"); | ||
var sinon = require("sinon"); | ||
var expect = require("chai").expect; | ||
|
||
var DefaultContent = require("../DefaultContent"); | ||
describe("DefaultContent", function() { | ||
describe("#render", function() { | ||
var renderer = TestUtils.createRenderer(); | ||
var result; | ||
beforeEach(function() { | ||
renderer.render( | ||
<DefaultContent /> | ||
); | ||
result = renderer.getRenderOutput(); | ||
}); | ||
|
||
it("should render HTML content", function() { | ||
expect(result.props.children.length > 0).to.be.true; | ||
}); | ||
}); | ||
|
||
var fakeCreateText = jasmine.createSpy("fakeCreateText"); | ||
var fakeCreateTodo = jasmine.createSpy("fakeCreateTodo"); | ||
describe("add default items", function() { | ||
var comp; | ||
var fakeCreateText = sinon.spy(); | ||
var fakeCreateTodo = sinon.spy(); | ||
|
||
function fakeNewItem(type) { | ||
return type === "text" ? fakeCreateText : fakeCreateTodo; | ||
} | ||
function fakeNewItem(type) { | ||
return type === "text" ? fakeCreateText : fakeCreateTodo; | ||
} | ||
|
||
beforeEach(function() { | ||
comp = TestUtils.renderIntoDocument(<DefaultContent newItem={fakeNewItem} />); | ||
}); | ||
beforeEach(function() { | ||
comp = TestUtils.renderIntoDocument( | ||
<DefaultContent newItem={fakeNewItem} /> | ||
); | ||
}); | ||
|
||
it("should render HTML content", function() { | ||
expect(comp.getDOMNode().outerHTML.length > 0).toBe(true); | ||
}); | ||
it("should add a new text entry when clicking on Text link", function() { | ||
|
||
it("should add a new text entry when clicking on Text link", function() { | ||
var newTextLink = TestUtils.findRenderedDOMComponentWithClass(comp, "new-text"); | ||
var newTextLink = TestUtils.findRenderedDOMComponentWithClass(comp, "new-text"); | ||
|
||
TestUtils.Simulate.click(newTextLink); | ||
TestUtils.Simulate.click(newTextLink); | ||
|
||
expect(fakeCreateText).toHaveBeenCalled(); | ||
}); | ||
expect(fakeCreateText.calledOnce).to.be.true; | ||
}); | ||
|
||
it("should add a new todo entry when clicking on Todo link", function() { | ||
var newTodoLink = TestUtils.findRenderedDOMComponentWithClass(comp, "new-todo"); | ||
it("should add a new todo entry when clicking on Todo link", function() { | ||
var newTodoLink = TestUtils.findRenderedDOMComponentWithClass(comp, "new-todo"); | ||
|
||
TestUtils.Simulate.click(newTodoLink); | ||
TestUtils.Simulate.click(newTodoLink); | ||
|
||
expect(fakeCreateTodo).toHaveBeenCalled(); | ||
expect(fakeCreateTodo.calledOnce).to.be.true; | ||
}); | ||
}); | ||
}); |
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
Oops, something went wrong.