@@ -29,7 +29,6 @@ QUnit.test( 'reset elements', function( assert ) {
2929 fixture . append ( '<div id="wpe-pcc-standardMode">Hello this is text.</div>' ) ;
3030 fixture . append ( '<textarea id="testResults">This is some more text!</textarea>' ) ;
3131 fixture . append ( '<div id="wpe-progress-count"></div>' ) ;
32- fixture . append ( '<div id="progressbar"></div>' ) ;
3332
3433 // Set the progress bar to a known state.
3534 jQuery ( '#progressbar' ) . progressbar ( { value : 5 } ) ;
@@ -39,7 +38,6 @@ QUnit.test( 'reset elements', function( assert ) {
3938 assert . ok ( '' === $ ( '#testResults' ) . text ( ) , 'testResults is empty' ) ;
4039 assert . ok ( '' === $ ( '#wpe-pcc-standardMode' ) . html ( ) , 'wpe-pcc-standardMode is empty' ) ;
4140 assert . ok ( '' === $ ( '#wpe-progress-count' ) . text ( ) , 'wpe-progress-count is empty' ) ;
42- assert . ok ( 0 === $ ( '#progressbar' ) . progressbar ( 'value' ) , 'progressbar is set to 0' ) ;
4341} ) ;
4442
4543QUnit . module ( 'displayReport' ) ;
@@ -54,12 +52,9 @@ QUnit.test( 'Render test pass', function( assert ) {
5452 displayReport ( helpers . passResults ) ;
5553
5654 var displayedResults = $ ( '#testResults' ) . text ( ) ;
57-
5855 assert . ok ( helpers . passResults === displayedResults , 'Text results are correct' ) ;
59- // assert.ok( $('#footer').is(':visible'), 'Footer is visible' );
60- assert . ok ( $ ( '.wpe-pcc-alert' ) . length == 2 , 'There are 2 results.' ) ;
61- assert . ok ( $ ( '#wpe-pcc-standardMode' ) . text ( ) . indexOf ( 'Your WordPress install is PHP 5.5 compatible.' ) !== - 1 , 'Test did pass.' ) ;
62- assert . ok ( '#038103' === helpers . rgb2hex ( $ ( ".wpe-pcc-alert" ) . eq ( 0 ) . css ( 'border-left-color' ) ) , 'First plugin marked as passed.' ) ;
56+ assert . ok ( $ ( '.wpe-pcc-alert' ) . length == 2 , 'There are 2 results.' ) ;
57+ assert . ok ( $ ( '.wpe-pcc-alert' ) . eq ( 0 ) . hasClass ( 'wpe-pcc-alert-passed' ) , 'First plugin marked as passed.' ) ;
6358 assert . ok ( $ ( '#wpe-pcc-standardMode' ) . text ( ) . indexOf ( '0 out of 2' ) === - 1 , 'No scan stats are shown.' ) ;
6459} ) ;
6560
@@ -75,9 +70,7 @@ QUnit.test( 'Render test fail', function( assert ) {
7570 var displayedResults = $ ( '#testResults' ) . text ( ) ;
7671
7772 assert . ok ( helpers . failResults === displayedResults , 'Text results are correct' ) ;
78- // assert.ok( $('#footer').is(':visible'), 'Footer is visible' );
7973 assert . ok ( $ ( '.wpe-pcc-alert' ) . length == 7 , 'There are 7 results.' ) ;
80- assert . ok ( $ ( '#wpe-pcc-standardMode' ) . text ( ) . indexOf ( 'Your WordPress install is not PHP 5.5 compatible.' ) !== - 1 , 'Test did not pass.' ) ;
8174 assert . ok ( $ ( '#wpe-pcc-standardMode' ) . text ( ) . indexOf ( '1 out of 7' ) !== - 1 , 'Scan stats are correct' ) ;
8275} ) ;
8376
@@ -92,8 +85,8 @@ QUnit.test( 'Render test skip', function( assert ) {
9285
9386 var displayedResults = $ ( '#testResults' ) . text ( ) ;
9487
95- assert . ok ( '#038103' === helpers . rgb2hex ( $ ( " .wpe-pcc-alert" ) . eq ( 0 ) . css ( 'border-left-color' ) ) , 'First plugin marked as passed.' ) ;
96- assert . ok ( '#999999' === helpers . rgb2hex ( $ ( " .wpe-pcc-alert" ) . eq ( 1 ) . css ( 'border-left-color' ) ) , 'Second plugin marked as skipped.' ) ;
88+ assert . ok ( $ ( ' .wpe-pcc-alert' ) . eq ( 0 ) . hasClass ( 'wpe-pcc-alert-passed' ) , 'First plugin marked as passed.' ) ;
89+ assert . ok ( $ ( ' .wpe-pcc-alert' ) . eq ( 1 ) . hasClass ( 'wpe-pcc-alert-skipped' ) , 'Second plugin marked as skipped.' ) ;
9790} ) ;
9891
9992QUnit . module ( 'checkStatus' ) ;
@@ -102,7 +95,7 @@ QUnit.test( 'Test checkStatus progress', function( assert ) {
10295 // This will be an async test since it involves callbacks.
10396 var done = assert . async ( ) ;
10497 var fixture = $ ( '#qunit-fixture' ) ;
105- fixture . append ( '<div id="wpe-progress-count"></div>' ) ;
98+ fixture . append ( '<div id="wpe-pcc- progress-count"></div>' ) ;
10699 fixture . append ( '<div id="progressbar"></div>' ) ;
107100
108101 // Define our mock URL.
@@ -118,9 +111,7 @@ QUnit.test( 'Test checkStatus progress', function( assert ) {
118111 return true ;
119112 } ,
120113 onAfterComplete : function ( ) { // Check the results of checkStatus();
121- assert . ok ( $ ( '#wpe-progress-count' ) . text ( ) === '17/17' , 'Progress count is correct.' ) ;
122- assert . ok ( $ ( '#progressbar' ) . progressbar ( 'value' ) === 94.1176470588 , 'Progress bar is correct.' ) ;
123-
114+ assert . ok ( $ ( '#wpe-pcc-progress-count' ) . text ( ) === '(17 of 17)' , 'Progress count is correct.' ) ;
124115 // Clear the next queued checkStatus call.
125116 clearTimeout ( timer ) ;
126117 // End the test.
@@ -135,7 +126,7 @@ QUnit.test( 'Test checkStatus progress', function( assert ) {
135126QUnit . test ( 'Test checkStatus done' , function ( assert ) {
136127 var done = assert . async ( ) ;
137128 var fixture = $ ( '#qunit-fixture' ) ;
138- fixture . append ( '<div id="wpe-progress"><div id="wpe-progress-count"></div></div>' ) ;
129+ fixture . append ( '<div id="wpe-progress"><div id="wpe-pcc- progress-count"></div></div>' ) ;
139130
140131 ajaxurl = '/checkStatus/done/' ;
141132
@@ -148,7 +139,7 @@ QUnit.test( 'Test checkStatus done', function( assert ) {
148139 return true ;
149140 } ,
150141 onAfterComplete : function ( ) {
151- assert . ok ( ! $ ( '#wpe-progress' ) . is ( ':visible' ) , 'Progress div is hidden.' ) ;
142+ assert . ok ( ! $ ( '#wpe-pcc- progress-count ' ) . is ( ':visible' ) , 'Progress div is hidden.' ) ;
152143 clearTimeout ( timer ) ;
153144 done ( ) ;
154145 }
@@ -160,7 +151,6 @@ QUnit.test( 'Test checkStatus done', function( assert ) {
160151QUnit . test ( 'Test checkStatus fail JSON.parse' , function ( assert ) {
161152 var done = assert . async ( ) ;
162153 var fixture = $ ( '#qunit-fixture' ) ;
163- fixture . append ( '<div id="wpe-progress"><div id="wpe-progress-count"></div></div>' ) ;
164154
165155 ajaxurl = '/checkStatus/fail/json/' ;
166156 var callCount = 0 ;
@@ -177,7 +167,6 @@ QUnit.test( 'Test checkStatus fail JSON.parse', function( assert ) {
177167 return true ;
178168 } ,
179169 onAfterComplete : function ( ) {
180- assert . ok ( $ ( '#wpe-progress' ) . is ( ':visible' ) , 'Progress div is visible.' ) ;
181170 // Ensure that an alert was popped with the JSON SyntaxError.
182171 assert . ok ( - 1 !== alertText . toString ( ) . search ( 'SyntaxError' ) , 'Got JSON parse error in alert.' ) ;
183172 assert . ok ( 1 === callCount , 'Alert was called.' ) ;
0 commit comments