Left: | ||
Right: |
OLD | NEW |
---|---|
1 /* | 1 /* |
2 This file is part of the Juju GUI, which lets users view and manage Juju | 2 This file is part of the Juju GUI, which lets users view and manage Juju |
3 environments within a graphical interface (https://launchpad.net/juju-gui). | 3 environments within a graphical interface (https://launchpad.net/juju-gui). |
4 Copyright (C) 2012-2013 Canonical Ltd. | 4 Copyright (C) 2012-2013 Canonical Ltd. |
5 | 5 |
6 This program is free software: you can redistribute it and/or modify it under | 6 This program is free software: you can redistribute it and/or modify it under |
7 the terms of the GNU Affero General Public License version 3, as published by | 7 the terms of the GNU Affero General Public License version 3, as published by |
8 the Free Software Foundation. | 8 the Free Software Foundation. |
9 | 9 |
10 This program is distributed in the hope that it will be useful, but WITHOUT | 10 This program is distributed in the hope that it will be useful, but WITHOUT |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
82 it('should display new notifications on top', function() { | 82 it('should display new notifications on top', function() { |
83 makeNotifier('mytitle1', 'mymessage1'); | 83 makeNotifier('mytitle1', 'mymessage1'); |
84 makeNotifier('mytitle2', 'mymessage2'); | 84 makeNotifier('mytitle2', 'mymessage2'); |
85 var notifierNode = notifierBox.one('*'); | 85 var notifierNode = notifierBox.one('*'); |
86 assert.equal('mytitle2', notifierNode.one('h3').getContent()); | 86 assert.equal('mytitle2', notifierNode.one('h3').getContent()); |
87 assert.equal('mymessage2', notifierNode.one('div').getContent()); | 87 assert.equal('mymessage2', notifierNode.one('div').getContent()); |
88 }); | 88 }); |
89 | 89 |
90 it('should destroy notifications after N milliseconds', function(done) { | 90 it('should destroy notifications after N milliseconds', function(done) { |
91 makeNotifier('mytitle', 'mymessage', 1); | 91 makeNotifier('mytitle', 'mymessage', 1); |
92 // A timeout of 250 milliseconds is used so that we ensure the destroying | 92 // A timeout is used so that we ensure the destroying animation can be |
93 // animation can be completed. | 93 // completed. |
94 setTimeout(function() { | 94 setTimeout(function() { |
95 assertNumNotifiers(0); | 95 assertNumNotifiers(0); |
96 done(); | 96 done(); |
97 }, 250); | 97 }, 500); |
benjamin.saller
2013/06/25 21:29:18
That must have been a hard one to track down.
benji
2013/06/26 13:43:54
:)
| |
98 }); | 98 }); |
99 | 99 |
100 it('should destroy notifications on click', function(done) { | 100 it('should destroy notifications on click', function(done) { |
101 makeNotifier(); | 101 makeNotifier(); |
102 notifierBox.one('*').simulate('click'); | 102 notifierBox.one('*').simulate('click'); |
103 // A timeout of 250 milliseconds is used so that we ensure the destroying | 103 // A timeout is used so that we ensure the destroying animation can be |
104 // animation can be completed. | 104 // completed. |
105 setTimeout(function() { | 105 setTimeout(function() { |
106 assertNumNotifiers(0); | 106 assertNumNotifiers(0); |
107 done(); | 107 done(); |
108 }, 250); | 108 }, 500); |
109 }); | 109 }); |
110 | 110 |
111 it('should prevent notification removal on mouse enter', function(done) { | 111 it('should prevent notification removal on mouse enter', function(done) { |
112 makeNotifier('mytitle', 'mymessage', 1); | 112 makeNotifier('mytitle', 'mymessage', 1); |
113 notifierBox.one('*').simulate('mouseover'); | 113 notifierBox.one('*').simulate('mouseover'); |
114 // A timeout of 250 milliseconds is used so that we ensure the node is not | 114 // A timeout is used so that we ensure the destroying animation can be |
115 // preserved by the destroying animation. | 115 // completed. |
116 setTimeout(function() { | 116 setTimeout(function() { |
117 assertNumNotifiers(1); | 117 assertNumNotifiers(1); |
118 done(); | 118 done(); |
119 }, 250); | 119 }, 500); |
120 }); | 120 }); |
121 | 121 |
122 }); | 122 }); |
123 | 123 |
OLD | NEW |