LEFT | RIGHT |
1 // Replace the real app starting function with one that is more suitable | 1 // Replace the real app starting function with one that is more suitable |
2 // for testing. | 2 // for testing. |
3 startTheApp = function() { | 3 startTheApp = function() { |
4 appStarted = true; | 4 appStarted = true; |
5 }; | 5 }; |
6 | 6 |
7 getDocument = function() { | 7 getDocument = function() { |
8 return { | 8 return { |
9 getElementById: function(id) { | 9 getElementById: function(id) { |
10 if (id === 'browser-warning') { | 10 if (id === 'browser-warning') { |
(...skipping 28 matching lines...) Expand all Loading... |
39 assert.isNull(loadingStyle.display); | 39 assert.isNull(loadingStyle.display); |
40 displayBrowserWarning(); | 40 displayBrowserWarning(); |
41 assert.equal(warningStyle.display, 'block'); | 41 assert.equal(warningStyle.display, 'block'); |
42 }); | 42 }); |
43 | 43 |
44 it('will hide the browser warning when the user continues', function() { | 44 it('will hide the browser warning when the user continues', function() { |
45 continueWithCurrentBrowser(); | 45 continueWithCurrentBrowser(); |
46 assert.equal(warningStyle.display, 'none'); | 46 assert.equal(warningStyle.display, 'none'); |
47 }); | 47 }); |
48 | 48 |
| 49 it('will display the loading message when the user continues', function() { |
| 50 continueWithCurrentBrowser(); |
| 51 assert.equal(loadingStyle.display, 'block'); |
| 52 }); |
| 53 |
49 it('will stop event propigation when the user continues', function() { | 54 it('will stop event propigation when the user continues', function() { |
50 var result = continueWithCurrentBrowser(); | 55 var result = continueWithCurrentBrowser(); |
51 // Since the function is an event handler of a submit button and we do | 56 // Since the function is an event handler of a submit button and we do |
52 // not want the form submittion to actually happen, the handler must | 57 // not want the form submittion to actually happen, the handler must |
53 // return false. | 58 // return false. |
54 assert.isFalse(result); | 59 assert.isFalse(result); |
55 }); | 60 }); |
56 | 61 |
57 it('will start the app when the user continues', function() { | 62 it('will start the app when the user continues', function() { |
58 continueWithCurrentBrowser(); | 63 continueWithCurrentBrowser(); |
59 assert.isTrue(appStarted); | 64 assert.isTrue(appStarted); |
60 }); | 65 }); |
61 | 66 |
62 it('will show a loading message while the app loads', function() { | |
63 // The loading message has not had it's default style touched yet. | |
64 assert.isNull(loadingStyle.display); | |
65 // The "go" function displays the loading message if there is no | |
66 // browser compatability warning. | |
67 go('Chrome'); | |
68 assert.equal(loadingStyle.display, 'block'); | |
69 assert.isNull(warningStyle.display); | |
70 }); | |
71 | |
72 it('will show a loading message after any browser wanting', function() { | 67 it('will show a loading message after any browser wanting', function() { |
73 // If the browser is not supported, then the loading message will be | 68 // If the browser is not supported, then the loading message will be |
74 // displayed after the browser warning. | 69 // displayed after the browser warning. |
75 go('Browser that does not exist, and therefore is not supported'); | 70 go('Browser that does not exist, and therefore is not supported'); |
76 assert.equal(warningStyle.display, 'block'); | 71 assert.equal(warningStyle.display, 'block'); |
77 assert.isNull(loadingStyle.display); | 72 assert.equal(loadingStyle.display, 'none'); |
78 continueWithCurrentBrowser(); | 73 continueWithCurrentBrowser(); |
79 assert.equal(warningStyle.display, 'none'); | 74 assert.equal(warningStyle.display, 'none'); |
80 assert.equal(loadingStyle.display, 'block'); | 75 assert.equal(loadingStyle.display, 'block'); |
81 }); | 76 }); |
82 | 77 |
83 }); | 78 }); |
84 }) (); | 79 }) (); |
LEFT | RIGHT |