import { fromJS } from 'immutable'
import * as taking from '../taking'

describe('taking selectors', () => {
  describe('getCurrentSessionItemPosition', () => {
    it('defaults to one', () => {
      const pos = taking.getCurrentSessionItemPosition(fromJS({}))
      expect(pos).to.eq(1)
    })

    it('gets the correct position', () => {
      const state = { taking: { currentSessionItemPosition: 2 } }
      const pos = taking.getCurrentSessionItemPosition(fromJS(state))
      expect(pos).to.eq(2)
    })
  })
})