From 3a82045f96d3b33db124d5e75b0b5168688a196c Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Sat, 21 Feb 2015 00:30:42 +0100 Subject: [PATCH] Added more tests. --- public/assets/tests/taskbar.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/public/assets/tests/taskbar.js b/public/assets/tests/taskbar.js index b13deabeb..8f2684a6b 100644 --- a/public/assets/tests/taskbar.js +++ b/public/assets/tests/taskbar.js @@ -22,6 +22,24 @@ test( "taskbar basic tests", function() { equal( $('#taskbars .content.active').length, 1, "check available active contents" ); equal( $('#taskbars .content.active').text(), "some test controller message:'#1',show:'true',hide:'false',active:'true'", "check active content!" ); + // verify + task = App.TaskManager.get( 'TestKey1' ) + equal( task.notify, false ) + deepEqual( task.state, undefined ) + deepEqual( task.params, { "message": "#1" } ) + + // update + App.TaskManager.update( 'TestKey1', { 'state': 'abc' } ) + App.TaskManager.update( 'TestKey1', { 'params': { a: 12 } } ) + App.TaskManager.notify( 'TestKey1' ) + + // verify + task = App.TaskManager.get( 'TestKey1' ) + equal( task.notify, true ) + deepEqual( task.state, 'abc' ) + deepEqual( task.params, { "a": 12 } ) + + App.TaskManager.execute({ key: 'TestKey2', controller: 'TestController1',