Skip to content

Commit

Permalink
add regression tests
Browse files Browse the repository at this point in the history
  • Loading branch information
charlieTheBotDev committed Jan 9, 2017
1 parent b22edf1 commit 4ab73be
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion modules/form-builder/test/spec.coffee
Original file line number Diff line number Diff line change
@@ -1 +1,29 @@
describe "hx-form-builder", ->
describe "hx-form-builder", ->
it 'should return the value for disabled fields', ->
form = new hx.Form(hx.detached('div').node())
.addText('Text')
.addText('Text', { key: 'text' })

form.data({
'text': '123',
'Text': '456'
})

form.disabled('Text', true)

form.data().should.eql({ Text: '456', text: '123' })


it 'should not return the value for hidden fields', ->
form = new hx.Form(hx.detached('div').node())
.addText('Text')
.addText('Text', { key: 'text' })

form.data({
'text': '123',
'Text': '456'
})

form.hidden('Text', true)

form.data().should.eql({ text: '123' })

0 comments on commit 4ab73be

Please sign in to comment.