Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(package): update to react 16 #2131

Merged
merged 20 commits into from
Oct 10, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions test/specs/modules/Sticky/Sticky-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,13 @@ describe('Sticky', () => {
mockPositions({ bottomOffset: 10, height: 50 })
wrapperMount(<Sticky {...positions} context={contextEl} onStick={onStick} onUnstick={onUnStick} />)

wrapper.childAt(1).should.have.style('position', 'fixed')
wrapper.childAt(0).childAt(1).should.have.style('position', 'fixed')
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

onStick.should.have.been.calledOnce()
onStick.should.have.been.calledWithMatch(undefined, positions)

wrapper.setProps({ active: false })
scrollToTop()
wrapper.childAt(1).should.have.not.style('position')
wrapper.childAt(0).childAt(1).should.have.not.style('position')
onUnStick.should.not.have.been.called()
})
})
Expand All @@ -150,8 +150,8 @@ describe('Sticky', () => {

// Scroll after trigger
scrollAfterTrigger()
wrapper.childAt(1).should.have.style('position', 'fixed')
wrapper.childAt(1).should.have.style('top', '12px')
wrapper.childAt(0).childAt(1).should.have.style('position', 'fixed')
wrapper.childAt(0).childAt(1).should.have.style('top', '12px')
})

it('should stick to bottom of context', () => {
Expand All @@ -160,8 +160,8 @@ describe('Sticky', () => {
wrapperMount(<Sticky {...positions} context={contextEl} />)

scrollAfterContext()
wrapper.childAt(1).should.have.style('position', 'fixed')
wrapper.childAt(1).should.have.style('top', '-101px')
wrapper.childAt(0).childAt(1).should.have.style('position', 'fixed')
wrapper.childAt(0).childAt(1).should.have.style('top', '-101px')
})
})
describe('onBottom', () => {
Expand Down Expand Up @@ -243,15 +243,15 @@ describe('Sticky', () => {
wrapper.setProps({ context: mockContextEl({ bottom: 0 }) })
domEvent.scroll(window)

wrapper.childAt(1).should.have.style('position', 'fixed')
wrapper.childAt(1).should.have.style('top', '-100px')
wrapper.childAt(0).childAt(1).should.have.style('position', 'fixed')
wrapper.childAt(0).childAt(1).should.have.style('top', '-100px')

// Scroll a bit before the top: component should stick to screen bottom
scrollAfterTrigger()

wrapper.childAt(1).should.have.style('bottom', '30px')
wrapper.childAt(1).should.have.style('position', 'fixed')
wrapper.childAt(1).should.not.have.style('top')
wrapper.childAt(0).childAt(1).should.have.style('bottom', '30px')
wrapper.childAt(0).childAt(1).should.have.style('position', 'fixed')
wrapper.childAt(0).childAt(1).should.not.have.style('top')
})

it('should stop pushing when reaching top', () => {
Expand All @@ -265,8 +265,8 @@ describe('Sticky', () => {
scrollAfterTrigger()

// Component should stick again to the top
wrapper.childAt(1).should.have.style('position', 'fixed')
wrapper.childAt(1).should.have.style('top', '10px')
wrapper.childAt(0).childAt(1).should.have.style('position', 'fixed')
wrapper.childAt(0).childAt(1).should.have.style('top', '10px')
})

it('should return true if oversized', () => {
Expand Down