Skip to content

Commit

Permalink
lint and fix test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
cht8687 committed May 22, 2016
1 parent ae2ad0d commit 6155acf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/ReactListView.js
Expand Up @@ -96,7 +96,7 @@ export default class ReactListView extends Component {
ignoreCheck = true
}
}
if (!ignoreCheck && (c.originalPosition) < (currentWindowScrollTop + this.state._headerFixedPosition + currentHeaderHeight * 1 )) {
if (!ignoreCheck && (c.originalPosition) < (currentWindowScrollTop + this.state._headerFixedPosition + currentHeaderHeight * 1)) {
Object.assign(currentNode.style, this.props.styles.fixedPosition)
// apply top value
currentNode.style.top = `${this.state._headerFixedPosition}px`
Expand Down
2 changes: 1 addition & 1 deletion src/example/Example.js
Expand Up @@ -20,7 +20,7 @@ let styles = {
fixedPosition: {
position: 'fixed',
width: '383px',
top: '0px',
top: '0px'
},

listHeader: {
Expand Down
7 changes: 3 additions & 4 deletions test/index.js
Expand Up @@ -10,18 +10,17 @@ import { sinon } from 'sinon'

test('----- React Component Tests: ReactListView -----', t => {
t.plan(3)
const app = shallow(<ReactListView data={data} headerAttName='headerName'itemsAttName='items' styles={styles} />)
const app = shallow(<ReactListView data={data} headerAttName='headerName' itemsAttName='items' styles={styles} />)
t.ok(ReactListView instanceof Function, 'should be function')
t.equal(5, app.find(ListHeader).length, 'should have 5 list headers')
t.equal(5, app.find(ListItems).length, 'should have 5 list items')
})

test('----- ReactListView state test-----', t => {
t.plan(2)
const app = shallow(<ReactListView data={data} headerAttName='headerName'itemsAttName='items' styles={styles} />)
const app = shallow(<ReactListView data={data} headerAttName='headerName' itemsAttName='items' styles={styles} />)
t.equal(7, app.update().state('events').length, 'should have 7 events in state')
t.equal(5, app.update().state('_instances').length, 'should have 5 instances')

t.ok(app.update().state('_instances') instanceof Object, 'should render _instances')
})

test('----- React Component Tests: ListHeader -----', t => {
Expand Down

0 comments on commit 6155acf

Please sign in to comment.