forms.js 450 B

12345678910111213141516171819
  1. /* eslint-env mocha */
  2. var assert = require('assert')
  3. var appendField = require('../')
  4. var testData = require('testdata-w3c-json-form')
  5. describe('Append Field', function () {
  6. for (var test of testData) {
  7. it('handles ' + test.name, function () {
  8. var store = Object.create(null)
  9. for (var field of test.fields) {
  10. appendField(store, field.key, field.value)
  11. }
  12. assert.deepEqual(store, test.expected)
  13. })
  14. }
  15. })