
var handler = require('./index').handler

describe('Update state', () => {
  it('should update one', done => {
    handler({
      "type": "Update state",
      "input": {
        "Property name": "Users/1/Foo",
        "Property value": "Bar"
      }
    }, null, (data) => {
      console.log(data)
      done()
    })
  })

  it('should update many', done => {
    handler({
      type: 'Update state',
      input: {
        'Properties': [
          {
            'Property name': 'Users/1/Bax',
            'Property value': { Hello: 'World' }
          }
        ]
      }
    }, null, (data) => {
      console.log(data)
      done()
    })
  })

  it('should update many', done => {
    handler({
      type: 'Update state',
      input: {
        'Properties': [
          {
            'Property name': 'Users/2/Foo',
            'Property value': { Hello: 'World' }
          }
        ]
      }
    }, null, (data) => {
      console.log(data)
      done()
    })
  })

  // Users/1/Bax: { id: 1, Bax: ... }
  // Users/id/Bax = all matches?
  // Users/sort
  // Users/limit
})
