Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add failing unit test #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion test/sanity.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,19 @@ test('NGN.DATA.Model Basic Events', function (t) {
})

Peeps.once('record.create', function (record) {
t.ok(Peeps.records[0].firstname = 'Bob', 'Record creation event heard.')
var bob = Peeps.records[0]
t.ok(bob.firstname = 'Bob', 'Record creation event heard.')

// set up a field.invalid listener which should never be triggered
bob.on('field.invalid', function (e) {
t.fail('The fieldname ' + e.field + ' was marked invalid, but should be valid')
})

// Bob should have a default value of 15
t.ok(bob.val === 15)
// setting Bob's value to 19 should not trigger the field.invalid event
bob.val = 19
t.deepEqual(bob.valid, true, 'Record should still be valid')
t.end()
})

Expand Down