react-native-swipe-a-lot
Version:
A swipe component for React Native that works on iOS and Android.
37 lines (29 loc) • 626 B
JavaScript
import test from 'ava'
import expect from 'expect'
import reducer from './reducer'
import deepFreeze from 'deep-freeze'
test('set active page', () => {
const stateBefore = {}
const stateAfter = {
page: 2
}
deepFreeze(stateBefore)
expect(
reducer(stateBefore, {
type: 'SET_ACTIVE_PAGE',
page: 2
})
).toEqual(stateAfter)
})
test('set view dims', () => {
const stateBefore = {}
const stateAfter = { width: 200, height: 300 }
deepFreeze(stateBefore)
expect(
reducer(stateBefore, {
type: 'SET_DIMS',
width: 200,
height: 300
})
).toEqual(stateAfter)
})