Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
brainfood
/
rivets-error-binder
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
c3359bc1
authored
2016-05-24 14:26:02 -0500
by
Adam Heath
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Update to support rivets 0.9.
1 parent
dc86d552
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
12 deletions
bower.json
src/scripts/config.js
src/scripts/rivets-error-binder.spec.js
bower.json
View file @
c3359bc
...
...
@@ -11,8 +11,7 @@
"ignore"
:
[
"**/.*"
,
"node_modules"
,
"src/lib"
,
"test"
"src/lib"
],
"dependencies"
:
{
"backbone-seen"
:
"git@gitlab.brainfood.com:brainfood/backbone-seen.git"
,
...
...
src/scripts/config.js
View file @
c3359bc
...
...
@@ -24,6 +24,7 @@ require = (function() {
'backbone-validation'
:
'../lib/backbone-validation/dist/backbone-validation-amd'
,
backbone
:
'../lib/backbone/backbone'
,
underscore
:
'../lib/underscore/underscore'
,
sightglass
:
'../lib/sightglass/index'
,
rivets
:
'../lib/rivets/dist/rivets'
,
bootstrap
:
'../lib/bootstrap/dist/js/bootstrap'
,
jquery
:
'../lib/jquery/dist/jquery'
,
...
...
src/scripts/rivets-error-binder.spec.js
View file @
c3359bc
...
...
@@ -62,6 +62,14 @@ define(function(require) {
afterEach
(
function
()
{
view
.
unbind
();
});
function
triggerEvents
(
$e
,
val
)
{
$e
.
triggerHandler
(
'focus'
);
$e
.
val
(
val
);
$e
.
triggerHandler
(
'input'
);
$e
.
triggerHandler
(
'change'
);
$e
.
triggerHandler
(
'blur'
);
jasmine
.
Clock
.
tick
(
1
);
}
it
(
'existing-no-render'
,
function
()
{
...
...
@@ -83,13 +91,11 @@ define(function(require) {
expect
(
$1
.
val
()).
toEqual
(
'CONSTANT'
);
expect
(
render
.
counts
).
toEqual
({
focus
:
0
,
blur
:
0
,
validatedError
:
0
,
validatedClean
:
0
});
$1
.
focus
().
val
(
'one'
).
change
().
blur
();
jasmine
.
Clock
.
tick
(
1
);
triggerEvents
(
$1
,
'one'
);
expect
(
test
.
get
(
'constant'
)).
toEqual
(
'one'
);
expect
(
render
.
counts
).
toEqual
({
focus
:
0
,
blur
:
0
,
validatedError
:
0
,
validatedClean
:
0
});
$1
.
focus
().
val
(
''
).
change
().
blur
();
jasmine
.
Clock
.
tick
(
1
);
triggerEvents
(
$1
,
''
);
expect
(
test
.
get
(
'constant'
)).
toEqual
(
''
);
expect
(
render
.
counts
).
toEqual
({
focus
:
0
,
blur
:
0
,
validatedError
:
0
,
validatedClean
:
0
});
jasmine
.
Clock
.
tick
(
1
);
...
...
@@ -116,13 +122,11 @@ define(function(require) {
expect
(
$1
.
val
()).
toEqual
(
'CONSTANT'
);
expect
(
render
.
counts
).
toEqual
({
focus
:
0
,
blur
:
0
,
validatedError
:
0
,
validatedClean
:
0
});
$1
.
focus
().
val
(
'one'
).
change
().
blur
();
jasmine
.
Clock
.
tick
(
1
);
triggerEvents
(
$1
,
'one'
);
expect
(
test
.
get
(
'constant'
)).
toEqual
(
'one'
);
expect
(
render
.
counts
).
toEqual
({
focus
:
1
,
blur
:
1
,
validatedError
:
0
,
validatedClean
:
1
});
$1
.
focus
().
val
(
''
).
change
().
blur
();
jasmine
.
Clock
.
tick
(
1
);
triggerEvents
(
$1
,
''
);
expect
(
test
.
get
(
'constant'
)).
toEqual
(
''
);
expect
(
render
.
counts
).
toEqual
({
focus
:
2
,
blur
:
2
,
validatedError
:
1
,
validatedClean
:
1
});
jasmine
.
Clock
.
tick
(
1
);
...
...
@@ -138,8 +142,7 @@ define(function(require) {
expect
(
view
).
toBeTruthy
();
expect
(
$1
.
val
()).
toEqual
(
''
);
$1
.
focus
().
val
(
'one'
).
change
().
blur
();
jasmine
.
Clock
.
tick
(
1
);
triggerEvents
(
$1
,
'one'
);
});
});
});
...
...
Please
register
or
sign in
to post a comment