Improved core js tests.

This commit is contained in:
Martin Edenhofer 2014-05-31 18:06:08 +02:00
parent 43765fc674
commit dd42805d33
5 changed files with 26 additions and 15 deletions

View file

@ -1238,6 +1238,10 @@ class App.ControllerForm extends App.Controller
if form.children()[0]
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>
else if form.parents('form')[0]
form = form.parents('form')

View file

@ -2,7 +2,12 @@ class Index extends App.Controller
constructor: ->
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')
@navigate '#getting_started'
return

View file

@ -177,7 +177,9 @@ class Widget extends App.Controller
messages: @messageLog
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
if @focus

View file

@ -203,20 +203,20 @@ App.Interval.set( function() {
'interval-test1'
);
App.Delay.set( function() {
test( "interval - test 1 - 1/1", function() {
test( "interval - test 1 - 1/2", function() {
// check
equal( window.testInterval1, 6, 'interval - test 1' );
equal( window.testInterval1, 4, 'interval - test 1' );
App.Interval.clear('interval-test1')
});
},
2400
);
App.Delay.set( function() {
test( "interval - test 1 - 1/1", function() {
test( "interval - test 1 - 2/2", function() {
// check
equal( window.testInterval1, 6, 'interval - test after clear' );
equal( window.testInterval1, 4, 'interval - test after clear' );
});
},
3500
@ -228,28 +228,28 @@ window.testInterval2 = 1
App.Interval.set( function() {
window.testInterval2 += 1;
},
500,
1000,
undefined,
'page'
'someLevel'
);
App.Delay.set( function() {
test( "interval - test 2 - 1/1", function() {
test( "interval - test 2 - 1/2", function() {
// check
equal( window.testInterval2, 6, 'interval - test 2' );
App.Interval.clearLevel('page')
equal( window.testInterval2, 4, 'interval - test 2' );
App.Interval.clearLevel('someLevel')
});
},
2400
4900
);
App.Delay.set( function() {
test( "interval - test 2 - 1/1", function() {
test( "interval - test 2 - 2/2", function() {
// check
equal( window.testInterval2, 6, 'interval - test 2 - after clear' );
equal( window.testInterval2, 4, 'interval - test 2 - after clear' );
});
},
3500
6000
);