Improved core js tests.
This commit is contained in:
parent
43765fc674
commit
dd42805d33
5 changed files with 26 additions and 15 deletions
|
@ -1238,6 +1238,10 @@ class App.ControllerForm extends App.Controller
|
||||||
if form.children()[0]
|
if form.children()[0]
|
||||||
form = form.children().parents('form')
|
form = form.children().parents('form')
|
||||||
|
|
||||||
|
# find form based on parents next <form>
|
||||||
|
else if form.is('form')
|
||||||
|
form = form
|
||||||
|
|
||||||
# find form based on parents next <form>
|
# find form based on parents next <form>
|
||||||
else if form.parents('form')[0]
|
else if form.parents('form')[0]
|
||||||
form = form.parents('form')
|
form = form.parents('form')
|
||||||
|
|
|
@ -2,7 +2,12 @@ class Index extends App.Controller
|
||||||
|
|
||||||
constructor: ->
|
constructor: ->
|
||||||
super
|
super
|
||||||
|
|
||||||
|
# no default routing on test pages
|
||||||
|
if window.location.pathname.substr(0,5) is '/test'
|
||||||
|
return
|
||||||
|
|
||||||
|
# route to getting started screen
|
||||||
if !@Config.get('system_init_done')
|
if !@Config.get('system_init_done')
|
||||||
@navigate '#getting_started'
|
@navigate '#getting_started'
|
||||||
return
|
return
|
||||||
|
|
|
@ -177,7 +177,9 @@ class Widget extends App.Controller
|
||||||
messages: @messageLog
|
messages: @messageLog
|
||||||
isShown: shown
|
isShown: shown
|
||||||
)
|
)
|
||||||
document.getElementById('chat_log_container').scrollTop = 10000
|
|
||||||
|
if document.getElementById('chat_log_container')
|
||||||
|
document.getElementById('chat_log_container').scrollTop = 10000
|
||||||
|
|
||||||
# focus in input box
|
# focus in input box
|
||||||
if @focus
|
if @focus
|
||||||
|
|
|
@ -203,20 +203,20 @@ App.Interval.set( function() {
|
||||||
'interval-test1'
|
'interval-test1'
|
||||||
);
|
);
|
||||||
App.Delay.set( function() {
|
App.Delay.set( function() {
|
||||||
test( "interval - test 1 - 1/1", function() {
|
test( "interval - test 1 - 1/2", function() {
|
||||||
|
|
||||||
// check
|
// check
|
||||||
equal( window.testInterval1, 6, 'interval - test 1' );
|
equal( window.testInterval1, 4, 'interval - test 1' );
|
||||||
App.Interval.clear('interval-test1')
|
App.Interval.clear('interval-test1')
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
2400
|
2400
|
||||||
);
|
);
|
||||||
App.Delay.set( function() {
|
App.Delay.set( function() {
|
||||||
test( "interval - test 1 - 1/1", function() {
|
test( "interval - test 1 - 2/2", function() {
|
||||||
|
|
||||||
// check
|
// check
|
||||||
equal( window.testInterval1, 6, 'interval - test after clear' );
|
equal( window.testInterval1, 4, 'interval - test after clear' );
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
3500
|
3500
|
||||||
|
@ -228,28 +228,28 @@ window.testInterval2 = 1
|
||||||
App.Interval.set( function() {
|
App.Interval.set( function() {
|
||||||
window.testInterval2 += 1;
|
window.testInterval2 += 1;
|
||||||
},
|
},
|
||||||
500,
|
1000,
|
||||||
undefined,
|
undefined,
|
||||||
'page'
|
'someLevel'
|
||||||
);
|
);
|
||||||
App.Delay.set( function() {
|
App.Delay.set( function() {
|
||||||
test( "interval - test 2 - 1/1", function() {
|
test( "interval - test 2 - 1/2", function() {
|
||||||
|
|
||||||
// check
|
// check
|
||||||
equal( window.testInterval2, 6, 'interval - test 2' );
|
equal( window.testInterval2, 4, 'interval - test 2' );
|
||||||
App.Interval.clearLevel('page')
|
App.Interval.clearLevel('someLevel')
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
2400
|
4900
|
||||||
);
|
);
|
||||||
App.Delay.set( function() {
|
App.Delay.set( function() {
|
||||||
test( "interval - test 2 - 1/1", function() {
|
test( "interval - test 2 - 2/2", function() {
|
||||||
|
|
||||||
// check
|
// check
|
||||||
equal( window.testInterval2, 6, 'interval - test 2 - after clear' );
|
equal( window.testInterval2, 4, 'interval - test 2 - after clear' );
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
3500
|
6000
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue