Browse Source

fixing failing unit tests in travisCI

El RIDO 7 years ago
parent
commit
2cbf528894
4 changed files with 6 additions and 10 deletions
  1. 4 4
      js/privatebin.js
  2. 0 4
      js/test/Alert.js
  3. 1 1
      tpl/bootstrap.php
  4. 1 1
      tpl/page.php

+ 4 - 4
js/privatebin.js

@@ -4817,10 +4817,6 @@ jQuery.PrivateBin = (function($, RawDeflate) {
 
             // initialize other modules/"classes"
             Alert.init();
-            if (!InitialCheck.init()) {
-                // something major is wrong, stop right away
-                return;
-            }
             Model.init();
             AttachmentViewer.init();
             DiscussionViewer.init();
@@ -4831,6 +4827,10 @@ jQuery.PrivateBin = (function($, RawDeflate) {
             TopNav.init();
             UiHelper.init();
             z = (await zlib);
+            if (!InitialCheck.init()) {
+                // something major is wrong, stop right away
+                return;
+            }
 
             // check whether existing paste needs to be shown
             try {

+ 0 - 4
js/test/Alert.js

@@ -3,10 +3,6 @@ var common = require('../common');
 
 describe('Alert', function () {
     describe('showStatus', function () {
-        before(function () {
-            cleanup();
-        });
-
         jsc.property(
             'shows a status message',
             jsc.array(common.jscAlnumString()),

+ 1 - 1
tpl/bootstrap.php

@@ -71,7 +71,7 @@ if ($MARKDOWN):
 endif;
 ?>
 		<script type="text/javascript" data-cfasync="false" src="js/purify-1.0.11.js" integrity="sha512-p7UyJuyBkhMcMgE4mDsgK0Lz70OvetLefua1oXs1OujWv9gOxh4xy8InFux7bZ4/DAZsTmO4rgVwZW9BHKaTaw==" crossorigin="anonymous"></script>
-		<script type="text/javascript" data-cfasync="false" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-yrdGnBnMXuR3FYwWA7kHON7f7Beqr7EvUnIH4/m3qUuLaudXIcqJnt6qLIWLGL5E156DcVZc460rLzUGKlSHsA==" crossorigin="anonymous"></script>
+		<script type="text/javascript" data-cfasync="false" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-Yq2HyT+H1PmQxCaDeh6E/ChOrTBSYsu8BuS4yb8UPHlyMVaxqSOtyfy6hx6vAsVT0G3bKeLRAuejhvPTOoz7fQ==" crossorigin="anonymous"></script>
 		<!--[if IE]>
 		<style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;}</style>
 		<![endif]-->

+ 1 - 1
tpl/page.php

@@ -49,7 +49,7 @@ if ($MARKDOWN):
 endif;
 ?>
 		<script type="text/javascript" data-cfasync="false" src="js/purify-1.0.11.js" integrity="sha512-p7UyJuyBkhMcMgE4mDsgK0Lz70OvetLefua1oXs1OujWv9gOxh4xy8InFux7bZ4/DAZsTmO4rgVwZW9BHKaTaw==" crossorigin="anonymous"></script>
-		<script type="text/javascript" data-cfasync="false" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-yrdGnBnMXuR3FYwWA7kHON7f7Beqr7EvUnIH4/m3qUuLaudXIcqJnt6qLIWLGL5E156DcVZc460rLzUGKlSHsA==" crossorigin="anonymous"></script>
+		<script type="text/javascript" data-cfasync="false" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-Yq2HyT+H1PmQxCaDeh6E/ChOrTBSYsu8BuS4yb8UPHlyMVaxqSOtyfy6hx6vAsVT0G3bKeLRAuejhvPTOoz7fQ==" crossorigin="anonymous"></script>
 		<!--[if IE]>
 		<style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;}</style>
 		<![endif]-->