text: /* eslint-env mocha */
  import { props, state } from '../tags'
  
  import App from '../'
  import assert from 'assert'
  import { shift } from './'
  
  describe('factory.shift', () => {
    it('should shift value in model', () => {
      const rootModule = {
        state: {
          list: ['a', 'b', 'c'],
        },
        sequences: {
          test: [shift(state`list`)],
        },
      }
      const controller = App(rootModule)
      controller.getSequence('test')()
      assert.deepEqual(controller.getState(), { list: ['b', 'c'] })
    })
    it('should throw on bad argument', (done) => {
      const rootModule = {
        state: {},
        sequences: {
          test: [shift(props`list`, 'bar')],
        },
      }
      const controller = App(rootModule)
  
      controller.removeListener('error')
      controller.once('error', (error) => {
        assert.ok(error)
        done()
      })
  
      controller.getSequence('test')()
    })
  })
  