Skip to content

Commit

Permalink
add contributors and ignore UMD in coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Ola Holmström committed Feb 24, 2015
1 parent 2d1131a commit c035f08
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 10 deletions.
6 changes: 6 additions & 0 deletions README.md
Expand Up @@ -130,6 +130,12 @@ be found in `examples/completion.html`.

[![Completion Demo](https://cdn.rawgit.com/olahol/react-tagsinput/master/example/demo_completion.gif "Completion Demo")](https://github.com/olahol/react-tagsinput/blob/master/example/completion.html)

## Contributors

* Ola Holmström (@olahol)
* Dmitri Voronianski (@voronianski)
* Artem Vovsya (@avovsya)

---

MIT Licensed
Expand Down
5 changes: 3 additions & 2 deletions bower.json
Expand Up @@ -16,8 +16,9 @@
"react-component"
],
"authors": [
"Ola Holmström",
"Dmitri Voronianski <dmitri.voronianski@gmail.com>"
"Ola Holmström <olaholmstrom@gmail.com>",
"Dmitri Voronianski <dmitri.voronianski@gmail.com>",
"Artem Vovsya <avovsya@gmail.com>"
],
"license": "MIT",
"ignore": [
Expand Down
10 changes: 5 additions & 5 deletions package.json
Expand Up @@ -14,7 +14,7 @@
},
"scripts": {
"test": "mocha"
, "coverage": "./node_modules/istanbul/lib/cli.js cover ./node_modules/mocha/bin/_mocha -- --ui bdd -R spec"
, "coverage": "./node_modules/istanbul/lib/cli.js cover --print detail ./node_modules/mocha/bin/_mocha -- --ui bdd -R spec"
},
"repository": {
"type": "git",
Expand All @@ -29,10 +29,10 @@
"react-component"
],
"author": "Ola Holmström",
"contributors": [{
"name": "Dmitri Voronianski",
"email": "dmitri.voronianski@gmail.com"
}],
"contributors": [
{ "name": "Dmitri Voronianski", "email": "dmitri.voronianski@gmail.com" },
{ "name": "Artem Vovsya", "email": "avovsya@gmail.com" }
],
"license": "MIT",
"bugs": {
"url": "https://github.com/olahol/react-tagsinput/issues"
Expand Down
1 change: 1 addition & 0 deletions react-tagsinput.js
@@ -1,4 +1,5 @@
;(function (root, factory) {
/* istanbul ignore next */
if (typeof module !== "undefined" && module.exports) {
module.exports = factory(require("react"));
} else if (typeof define === "function" && define.amd) {
Expand Down
19 changes: 16 additions & 3 deletions test/index.js
Expand Up @@ -25,7 +25,9 @@ describe("TagsInput", function () {

describe("main functionality", function () {
it("should add a tag on enter", function () {
var tagsinput = createTagsInput();
var tagsinput = createTagsInput({
classNamespace: ""
});
var input = addTag(tagsinput, "test");

assert.equal(tagsinput.getTags().length, 1);
Expand Down Expand Up @@ -83,22 +85,31 @@ describe("TagsInput", function () {
});

describe("props and methods", function () {
it("should test onBeforeAddTag validation", function () {
it("should test onBeforeTagAdd validation", function () {
var tagsinput = createTagsInput({ onBeforeTagAdd: function () { return false; } });
var input = addTag(tagsinput, "test");

assert.equal(tagsinput.getTags().length, 0);
assert.equal(input.props.value, "test");
});

it("should test onBeforeAddTag transformation", function () {
it("should test onBeforeTagAdd transformation", function () {
var tagsinput = createTagsInput({ onBeforeTagAdd: function () { return "test1"; } });
var input = addTag(tagsinput, "test");

assert.equal(tagsinput.getTags().length, 1);
assert.equal(tagsinput.getTags()[0], "test1");
});

it("should test onBeforeTagRemove validation", function () {
var tagsinput = createTagsInput({ onBeforeTagRemove: function () { return false; } });
var input = addTag(tagsinput, "test");

assert.equal(tagsinput.getTags().length, 1);
tagsinput.removeTag("test");
assert.equal(tagsinput.getTags().length, 1);
});

it("should test onChangeInput", function () {
var value = "";
var tagsinput = createTagsInput({
Expand Down Expand Up @@ -143,6 +154,8 @@ describe("TagsInput", function () {
TestUtils.Simulate.keyDown(input, { keyCode: 13 });
TestUtils.Simulate.change(input, { target: { value: "test3" } });
TestUtils.Simulate.blur(input);
TestUtils.Simulate.change(input, { target: { value: "" } });
TestUtils.Simulate.blur(input);

assert.equal(tagsinput.getTags().length, 3);
assert.deepEqual(value, ["test", "test2", "test3"]);
Expand Down

0 comments on commit c035f08

Please sign in to comment.