Browse Source

Fix intermittent test failures (#227)

Because we override the `window.onbeforeunload`, Chrome would sometimes
show a popup box when trying to close the window at the end of the tests.
Danilo Bargen 8 years ago
parent
commit
bc5a6878e9
6 changed files with 12 additions and 6 deletions
  1. 2 1
      tests/filters.js
  2. 2 1
      tests/helpers.js
  3. 2 1
      tests/service/message.js
  4. 2 1
      tests/service/mime.js
  5. 2 1
      tests/service/qrcode.js
  6. 2 1
      tests/service/uri.js

+ 2 - 1
tests/filters.js

@@ -2,7 +2,8 @@ describe('Filters', function() {
 
     let $filter;
 
-    beforeAll(() => window.onbeforeunload = () => 'Ignoring page reload request');
+    // Ignoring page reload request
+    beforeAll(() => window.onbeforeunload = () => null);
 
     beforeEach(function() {
 

+ 2 - 1
tests/helpers.js

@@ -2,7 +2,8 @@ describe('Helpers', function () {
 
     let stringService;
 
-    beforeAll(() => window.onbeforeunload = () => 'Ignoring page reload request');
+    // Ignoring page reload request
+    beforeAll(() => window.onbeforeunload = () => null);
 
     beforeEach(function () {
         // Load 3ema.services

+ 2 - 1
tests/service/message.js

@@ -2,7 +2,8 @@ describe('MessageService', function() {
 
     let messageService;
 
-    beforeAll(() => window.onbeforeunload = () => 'Ignoring page reload request');
+    // Ignoring page reload request
+    beforeAll(() => window.onbeforeunload = () => null);
 
     beforeEach(function() {
 

+ 2 - 1
tests/service/mime.js

@@ -2,7 +2,8 @@ describe('MimeService', function() {
 
     let $service;
 
-    beforeAll(() => window.onbeforeunload = () => 'Ignoring page reload request');
+    // Ignoring page reload request
+    beforeAll(() => window.onbeforeunload = () => null);
 
     beforeEach(function() {
 

+ 2 - 1
tests/service/qrcode.js

@@ -2,7 +2,8 @@ describe('QrCodeService', function() {
 
     let $service;
 
-    beforeAll(() => window.onbeforeunload = () => 'Ignoring page reload request');
+    // Ignoring page reload request
+    beforeAll(() => window.onbeforeunload = () => null);
 
     beforeEach(function() {
 

+ 2 - 1
tests/service/uri.js

@@ -2,7 +2,8 @@ describe('UriService', function() {
 
     let $service;
 
-    beforeAll(() => window.onbeforeunload = () => 'Ignoring page reload request');
+    // Ignoring page reload request
+    beforeAll(() => window.onbeforeunload = () => null);
 
     beforeEach(function() {