Skip to content

Commit

Permalink
v0.2.2
Browse files Browse the repository at this point in the history
- Fix the onClick function Bug. close #7
  + Remove onClick Function Test on elements.
    - Segment, Label, Icon, Header, Flag, Button
- Add Collections and Views Test Function.
  • Loading branch information
jessy1092 committed Jan 4, 2015
2 parents f4ee0be + ccb8095 commit 4c22fa0
Show file tree
Hide file tree
Showing 36 changed files with 521 additions and 125 deletions.
7 changes: 7 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Release Notes
=============

## Version 0.2.2 - 2015/01/05

- Fix the onClick function Bug. [issue #7](https://github.com/jessy1092/react-semantify/issues/7)
+ Remove onClick Function Test on elements.
- Segment, Label, Icon, Header, Flag, Button
- Add Collections and Views Test Function.

## Version 0.2.1 - 2015/01/03

- Fix the onClick function Bug: Use this.props.onClick to get the onClick function.
Expand Down
18 changes: 6 additions & 12 deletions dst/react-semantify.js
Original file line number Diff line number Diff line change
Expand Up @@ -585,8 +585,7 @@ module.exports = function (React) {
color: this.getColor(),
disabled: this.getDisabled(),
active: this.getActive(),
loading: this.getLoading(),
onClick: this.onClick}),
loading: this.getLoading()}),
this.props.children
)
);
Expand Down Expand Up @@ -642,8 +641,7 @@ module.exports = function (React) {
React.createElement(Unit, React.__spread({}, other,
{className: this.getClassName(defaultClassName),
type: "icon",
color: "null",
onClick: this.onClick})
color: "null"})
)
);
}
Expand Down Expand Up @@ -677,8 +675,7 @@ module.exports = function (React) {
{className: this.getClassName(defaultClassName),
type: this.getType(),
color: this.getColor(),
disabled: this.getDisabled(),
onClick: this.onClick}),
disabled: this.getDisabled()}),
this.props.children
)
);
Expand Down Expand Up @@ -713,8 +710,7 @@ module.exports = function (React) {
type: "icon",
color: this.getColor(),
disabled: this.getDisabled(),
loading: this.getLoading(),
onClick: this.onClick})
loading: this.getLoading()})
)
);
}
Expand Down Expand Up @@ -832,8 +828,7 @@ module.exports = function (React) {
React.createElement(Unit, React.__spread({}, other,
{className: this.getClassName(defaultClassName),
type: this.getType(),
color: this.getColor(),
onClick: this.onClick}),
color: this.getColor()}),
this.props.children
)
);
Expand Down Expand Up @@ -989,8 +984,7 @@ module.exports = function (React) {
type: "div",
color: this.getColor(),
disabled: this.getDisabled(),
loading: this.getLoading(),
onClick: this.onClick})
loading: this.getLoading()})
)
);
}
Expand Down
4 changes: 2 additions & 2 deletions dst/react-semantify.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name" : "react-semantify",
"description": "Integrate Semantic-ui with react components.",
"version" : "0.2.1",
"version" : "0.2.2",
"keywords": [
"react",
"semantic-ui",
Expand Down
3 changes: 1 addition & 2 deletions src/elements/button.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ module.exports = function (React) {
color={this.getColor()}
disabled={this.getDisabled()}
active={this.getActive()}
loading={this.getLoading()}
onClick={this.onClick}>
loading={this.getLoading()}>
{this.props.children}
</Unit>
);
Expand Down
3 changes: 1 addition & 2 deletions src/elements/flag.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ module.exports = function (React) {
<Unit {...other}
className={this.getClassName(defaultClassName)}
type="icon"
color="null"
onClick={this.onClick}>
color="null">
</Unit>
);
}
Expand Down
3 changes: 1 addition & 2 deletions src/elements/header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ module.exports = function (React) {
className={this.getClassName(defaultClassName)}
type={this.getType()}
color={this.getColor()}
disabled={this.getDisabled()}
onClick={this.onClick}>
disabled={this.getDisabled()}>
{this.props.children}
</Unit>
);
Expand Down
3 changes: 1 addition & 2 deletions src/elements/icon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ module.exports = function (React) {
type="icon"
color={this.getColor()}
disabled={this.getDisabled()}
loading={this.getLoading()}
onClick={this.onClick}>
loading={this.getLoading()}>
</Unit>
);
}
Expand Down
3 changes: 1 addition & 2 deletions src/elements/label.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ module.exports = function (React) {
<Unit {...other}
className={this.getClassName(defaultClassName)}
type={this.getType()}
color={this.getColor()}
onClick={this.onClick}>
color={this.getColor()}>
{this.props.children}
</Unit>
);
Expand Down
3 changes: 1 addition & 2 deletions src/elements/segment.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ module.exports = function (React) {
type="div"
color={this.getColor()}
disabled={this.getDisabled()}
loading={this.getLoading()}
onClick={this.onClick}>
loading={this.getLoading()}>
</Unit>
);
}
Expand Down
34 changes: 34 additions & 0 deletions test/__tests__/collections/Breadcrumb-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
"use strict";

jest.dontMock('../../../src/index.js');

var React = require('react');
var TestUtils = require('react/lib/ReactTestUtils');
var Breadcrumb = require('../../../src/index.js').Breadcrumb;

describe('Breadcrumb', function () {
it('should have .ui.breadcrumb class by default', function () {
var instance = TestUtils.renderIntoDocument(
<Breadcrumb></Breadcrumb>
);

expect(instance.getDOMNode().className).toMatch('ui');
expect(instance.getDOMNode().className).toMatch('breadcrumb');
});

it('should have child by default', function () {
var instance = TestUtils.renderIntoDocument(
<Breadcrumb>123</Breadcrumb>
);

expect(instance.getDOMNode().textContent).toMatch('123');
});

it('should have custom class with custom className', function () {
var instance = TestUtils.renderIntoDocument(
<Breadcrumb className="custom"></Breadcrumb>
);

expect(instance.getDOMNode().className).toMatch('custom');
});
});
34 changes: 34 additions & 0 deletions test/__tests__/collections/Form-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
"use strict";

jest.dontMock('../../../src/index.js');

var React = require('react');
var TestUtils = require('react/lib/ReactTestUtils');
var Form = require('../../../src/index.js').Form;

describe('Form', function () {
it('should have .ui.form class by default', function () {
var instance = TestUtils.renderIntoDocument(
<Form></Form>
);

expect(instance.getDOMNode().className).toMatch('ui');
expect(instance.getDOMNode().className).toMatch('form');
});

it('should have child by default', function () {
var instance = TestUtils.renderIntoDocument(
<Form>123</Form>
);

expect(instance.getDOMNode().textContent).toMatch('123');
});

it('should have custom class with custom className', function () {
var instance = TestUtils.renderIntoDocument(
<Form className="custom"></Form>
);

expect(instance.getDOMNode().className).toMatch('custom');
});
});
34 changes: 34 additions & 0 deletions test/__tests__/collections/Grid-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
"use strict";

jest.dontMock('../../../src/index.js');

var React = require('react');
var TestUtils = require('react/lib/ReactTestUtils');
var Grid = require('../../../src/index.js').Grid;

describe('Grid', function () {
it('should have .ui.grid class by default', function () {
var instance = TestUtils.renderIntoDocument(
<Grid></Grid>
);

expect(instance.getDOMNode().className).toMatch('ui');
expect(instance.getDOMNode().className).toMatch('grid');
});

it('should have child by default', function () {
var instance = TestUtils.renderIntoDocument(
<Grid>123</Grid>
);

expect(instance.getDOMNode().textContent).toMatch('123');
});

it('should have custom class with custom className', function () {
var instance = TestUtils.renderIntoDocument(
<Grid className="custom"></Grid>
);

expect(instance.getDOMNode().className).toMatch('custom');
});
});
34 changes: 34 additions & 0 deletions test/__tests__/collections/Menu-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
"use strict";

jest.dontMock('../../../src/index.js');

var React = require('react');
var TestUtils = require('react/lib/ReactTestUtils');
var Menu = require('../../../src/index.js').Menu;

describe('Menu', function () {
it('should have .ui.menu class by default', function () {
var instance = TestUtils.renderIntoDocument(
<Menu></Menu>
);

expect(instance.getDOMNode().className).toMatch('ui');
expect(instance.getDOMNode().className).toMatch('menu');
});

it('should have child by default', function () {
var instance = TestUtils.renderIntoDocument(
<Menu>123</Menu>
);

expect(instance.getDOMNode().textContent).toMatch('123');
});

it('should have custom class with custom className', function () {
var instance = TestUtils.renderIntoDocument(
<Menu className="custom"></Menu>
);

expect(instance.getDOMNode().className).toMatch('custom');
});
});
34 changes: 34 additions & 0 deletions test/__tests__/collections/Message-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
"use strict";

jest.dontMock('../../../src/index.js');

var React = require('react');
var TestUtils = require('react/lib/ReactTestUtils');
var Message = require('../../../src/index.js').Message;

describe('Message', function () {
it('should have .ui.message class by default', function () {
var instance = TestUtils.renderIntoDocument(
<Message></Message>
);

expect(instance.getDOMNode().className).toMatch('ui');
expect(instance.getDOMNode().className).toMatch('message');
});

it('should have child by default', function () {
var instance = TestUtils.renderIntoDocument(
<Message>123</Message>
);

expect(instance.getDOMNode().textContent).toMatch('123');
});

it('should have custom class with custom className', function () {
var instance = TestUtils.renderIntoDocument(
<Message className="custom"></Message>
);

expect(instance.getDOMNode().className).toMatch('custom');
});
});
34 changes: 34 additions & 0 deletions test/__tests__/collections/Table-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
"use strict";

jest.dontMock('../../../src/index.js');

var React = require('react');
var TestUtils = require('react/lib/ReactTestUtils');
var Table = require('../../../src/index.js').Table;

describe('Table', function () {
it('should have .ui.table class by default', function () {
var instance = TestUtils.renderIntoDocument(
<Table></Table>
);

expect(instance.getDOMNode().className).toMatch('ui');
expect(instance.getDOMNode().className).toMatch('table');
});

it('should have child by default', function () {
var instance = TestUtils.renderIntoDocument(
<Table>123</Table>
);

expect(instance.getDOMNode().textContent).toMatch('123');
});

it('should have custom class with custom className', function () {
var instance = TestUtils.renderIntoDocument(
<Table className="custom"></Table>
);

expect(instance.getDOMNode().className).toMatch('custom');
});
});
15 changes: 0 additions & 15 deletions test/__tests__/elements/Button-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,4 @@ describe('Button', function () {

expect(instance.getDOMNode().className).toMatch('loading');
});

it('should call onClick callback when button click', function (done) {

var clickOp = function () {
done();
};

var instance = TestUtils.renderIntoDocument(
<Button onClick={clickOp}></Button>
);

var button = TestUtils.findRenderedDOMComponentWithClass(instance, 'button');

TestUtils.Simulate.click(button);
});
});
15 changes: 0 additions & 15 deletions test/__tests__/elements/Flag-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,4 @@ describe('Flag', function () {

expect(instance.getDOMNode().className).toMatch('custom');
});

it('should call onClick callback when flag click', function (done) {

var clickOp = function () {
done();
};

var instance = TestUtils.renderIntoDocument(
<Flag onClick={clickOp}></Flag>
);

var flag = TestUtils.findRenderedDOMComponentWithClass(instance, 'flag');

TestUtils.Simulate.click(flag);
});
});
Loading

0 comments on commit 4c22fa0

Please sign in to comment.