12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- (function () {
- 'use strict';
- m.deps(window.mock());
- // Boilerplate QUnit acceptance test
- QUnit.acceptance = function(name, conf) {
- var title = document.title;
- var wrappedBeforeEach = conf.beforeEach;
- conf.beforeEach = function() {
- resetTestPromise();
- var modal = document.getElementById('modal-mount');
- $(modal).off();
- if (wrappedBeforeEach) {
- wrappedBeforeEach();
- }
- };
- var wrappedAfterEach = conf.afterEach;
- conf.afterEach = function(assert) {
- var cleaned = assert.async();
- var modal = document.getElementById('modal-mount');
- wrappedAfterEach();
- document.title = title;
- $.mockjax.clear();
- if(!$(modal).hasClass('in')) {
- window.setTimeout(cleaned, 300);
- } else {
- $(modal).on('hidden.bs.modal', function () {
- window.setTimeout(cleaned, 50);
- });
- }
- $(modal).modal('hide');
- };
- QUnit.module('Acceptance: ' + name, conf);
- };
- }());
|