muffin
Version:
The 21st century way of building websites
456 lines (390 loc) • 15.2 kB
JavaScript
define('muffin/tests/helpers/destroy-app', ['exports', 'ember'], function (exports, _ember) {
exports['default'] = destroyApp;
function destroyApp(application) {
_ember['default'].run(application, 'destroy');
}
});
define('muffin/tests/helpers/ember-simple-auth', ['exports', 'ember-simple-auth/authenticators/test'], function (exports, _emberSimpleAuthAuthenticatorsTest) {
exports.authenticateSession = authenticateSession;
exports.currentSession = currentSession;
exports.invalidateSession = invalidateSession;
var TEST_CONTAINER_KEY = 'authenticator:test';
function ensureAuthenticator(app, container) {
var authenticator = container.lookup(TEST_CONTAINER_KEY);
if (!authenticator) {
app.register(TEST_CONTAINER_KEY, _emberSimpleAuthAuthenticatorsTest['default']);
}
}
function authenticateSession(app, sessionData) {
var container = app.__container__;
var session = container.lookup('service:session');
ensureAuthenticator(app, container);
session.authenticate(TEST_CONTAINER_KEY, sessionData);
return wait();
}
;
function currentSession(app) {
return app.__container__.lookup('service:session');
}
;
function invalidateSession(app) {
var session = app.__container__.lookup('service:session');
if (session.get('isAuthenticated')) {
session.invalidate();
}
return wait();
}
;
});
define('muffin/tests/helpers/module-for-acceptance', ['exports', 'qunit', 'muffin/tests/helpers/start-app', 'muffin/tests/helpers/destroy-app'], function (exports, _qunit, _muffinTestsHelpersStartApp, _muffinTestsHelpersDestroyApp) {
exports['default'] = function (name) {
var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
(0, _qunit.module)(name, {
beforeEach: function beforeEach() {
this.application = (0, _muffinTestsHelpersStartApp['default'])();
if (options.beforeEach) {
options.beforeEach.apply(this, arguments);
}
},
afterEach: function afterEach() {
if (options.afterEach) {
options.afterEach.apply(this, arguments);
}
(0, _muffinTestsHelpersDestroyApp['default'])(this.application);
}
});
};
});
define('muffin/tests/helpers/resolver', ['exports', 'muffin/resolver', 'muffin/config/environment'], function (exports, _muffinResolver, _muffinConfigEnvironment) {
var resolver = _muffinResolver['default'].create();
resolver.namespace = {
modulePrefix: _muffinConfigEnvironment['default'].modulePrefix,
podModulePrefix: _muffinConfigEnvironment['default'].podModulePrefix
};
exports['default'] = resolver;
});
define('muffin/tests/helpers/start-app', ['exports', 'ember', 'muffin/app', 'muffin/config/environment'], function (exports, _ember, _muffinApp, _muffinConfigEnvironment) {
exports['default'] = startApp;
function startApp(attrs) {
var application = undefined;
var attributes = _ember['default'].merge({}, _muffinConfigEnvironment['default'].APP);
attributes = _ember['default'].merge(attributes, attrs); // use defaults, but you can override;
_ember['default'].run(function () {
application = _muffinApp['default'].create(attributes);
application.setupForTesting();
application.injectTestHelpers();
});
return application;
}
});
define('muffin/tests/integration/components/modal-overlay-test', ['exports', 'ember-qunit'], function (exports, _emberQunit) {
(0, _emberQunit.moduleForComponent)('modal-overlay', 'Integration | Component | modal overlay', {
integration: true
});
});
define('muffin/tests/integration/components/table-rows-test', ['exports', 'ember-qunit'], function (exports, _emberQunit) {
(0, _emberQunit.moduleForComponent)('table-rows', 'Integration | Component | table rows', {
integration: true
});
});
define('muffin/tests/integration/components/toggle-nav-test', ['exports', 'ember-qunit'], function (exports, _emberQunit) {
(0, _emberQunit.moduleForComponent)('toggle-nav', 'Integration | Component | toggle nav', {
integration: true
});
(0, _emberQunit.test)('it renders', function (assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.on('myAction', function(val) { ... });
this.render(Ember.HTMLBars.template((function () {
return {
meta: {
'fragmentReason': {
'name': 'missing-wrapper',
'problems': ['wrong-type']
},
'revision': 'Ember@2.5.1',
'loc': {
'source': null,
'start': {
'line': 1,
'column': 0
},
'end': {
'line': 1,
'column': 14
}
}
},
isEmpty: false,
arity: 0,
cachedFragment: null,
hasRendered: false,
buildFragment: function buildFragment(dom) {
var el0 = dom.createDocumentFragment();
var el1 = dom.createComment('');
dom.appendChild(el0, el1);
return el0;
},
buildRenderNodes: function buildRenderNodes(dom, fragment, contextualElement) {
var morphs = new Array(1);
morphs[0] = dom.createMorphAt(fragment, 0, 0, contextualElement);
dom.insertBoundary(fragment, 0);
dom.insertBoundary(fragment, null);
return morphs;
},
statements: [['content', 'toggle-nav', ['loc', [null, [1, 0], [1, 14]]]]],
locals: [],
templates: []
};
})()));
assert.equal(this.$().text().trim(), '');
// Template block usage:
this.render(Ember.HTMLBars.template((function () {
var child0 = (function () {
return {
meta: {
'fragmentReason': false,
'revision': 'Ember@2.5.1',
'loc': {
'source': null,
'start': {
'line': 2,
'column': 4
},
'end': {
'line': 4,
'column': 4
}
}
},
isEmpty: false,
arity: 0,
cachedFragment: null,
hasRendered: false,
buildFragment: function buildFragment(dom) {
var el0 = dom.createDocumentFragment();
var el1 = dom.createTextNode(' template block text\n');
dom.appendChild(el0, el1);
return el0;
},
buildRenderNodes: function buildRenderNodes() {
return [];
},
statements: [],
locals: [],
templates: []
};
})();
return {
meta: {
'fragmentReason': {
'name': 'missing-wrapper',
'problems': ['wrong-type']
},
'revision': 'Ember@2.5.1',
'loc': {
'source': null,
'start': {
'line': 1,
'column': 0
},
'end': {
'line': 5,
'column': 2
}
}
},
isEmpty: false,
arity: 0,
cachedFragment: null,
hasRendered: false,
buildFragment: function buildFragment(dom) {
var el0 = dom.createDocumentFragment();
var el1 = dom.createTextNode('\n');
dom.appendChild(el0, el1);
var el1 = dom.createComment('');
dom.appendChild(el0, el1);
var el1 = dom.createTextNode(' ');
dom.appendChild(el0, el1);
return el0;
},
buildRenderNodes: function buildRenderNodes(dom, fragment, contextualElement) {
var morphs = new Array(1);
morphs[0] = dom.createMorphAt(fragment, 1, 1, contextualElement);
return morphs;
},
statements: [['block', 'toggle-nav', [], [], 0, null, ['loc', [null, [2, 4], [4, 19]]]]],
locals: [],
templates: [child0]
};
})()));
assert.equal(this.$().text().trim(), 'template block text');
});
});
define('muffin/tests/test-helper', ['exports', 'muffin/tests/helpers/resolver', 'ember-qunit'], function (exports, _muffinTestsHelpersResolver, _emberQunit) {
(0, _emberQunit.setResolver)(_muffinTestsHelpersResolver['default']);
});
define('muffin/tests/unit/adapters/application-test', ['exports', 'ember-qunit'], function (exports, _emberQunit) {
(0, _emberQunit.moduleFor)('adapter:application', 'Unit | Adapter | application', {
// Specify the other units that are required for this test.
// needs: ['serializer:foo']
});
// Replace this with your real tests.
(0, _emberQunit.test)('it exists', function (assert) {
var adapter = this.subject();
assert.ok(adapter);
});
});
define('muffin/tests/unit/controllers/reset-password-test', ['exports', 'ember-qunit'], function (exports, _emberQunit) {
(0, _emberQunit.moduleFor)('controller:reset-password', 'Unit | Controller | reset password', {
// Specify the other units that are required for this test.
// needs: ['controller:foo']
});
// Replace this with your real tests.
(0, _emberQunit.test)('it exists', function (assert) {
var controller = this.subject();
assert.ok(controller);
});
});
define('muffin/tests/unit/initializers/setup-route-test', ['exports', 'ember', 'muffin/initializers/setup-route', 'qunit'], function (exports, _ember, _muffinInitializersSetupRoute, _qunit) {
var application = undefined;
(0, _qunit.module)('Unit | Initializer | setup route', {
beforeEach: function beforeEach() {
_ember['default'].run(function () {
application = _ember['default'].Application.create();
application.deferReadiness();
});
}
});
// Replace this with your real tests.
(0, _qunit.test)('it works', function (assert) {
_muffinInitializersSetupRoute['default'].initialize(application);
// you would normally confirm the results of the initializer here
assert.ok(true);
});
});
define('muffin/tests/unit/mixins/route-name-test', ['exports', 'ember', 'muffin/mixins/route-name', 'qunit'], function (exports, _ember, _muffinMixinsRouteName, _qunit) {
(0, _qunit.module)('Unit | Mixin | route name');
// Replace this with your real tests.
(0, _qunit.test)('it works', function (assert) {
var RouteNameObject = _ember['default'].Object.extend(_muffinMixinsRouteName['default']);
var subject = RouteNameObject.create();
assert.ok(subject);
});
});
define('muffin/tests/unit/models/file-test', ['exports', 'ember-qunit'], function (exports, _emberQunit) {
(0, _emberQunit.moduleForModel)('file', 'Unit | Model | file', {
// Specify the other units that are required for this test.
needs: []
});
(0, _emberQunit.test)('it exists', function (assert) {
var model = this.subject();
// let store = this.store();
assert.ok(!!model);
});
});
define('muffin/tests/unit/models/page-test', ['exports', 'ember-qunit'], function (exports, _emberQunit) {
(0, _emberQunit.moduleForModel)('page', 'Unit | Model | page', {
// Specify the other units that are required for this test.
needs: []
});
(0, _emberQunit.test)('it exists', function (assert) {
var model = this.subject();
// let store = this.store();
assert.ok(!!model);
});
});
define('muffin/tests/unit/models/user-test', ['exports', 'ember-qunit'], function (exports, _emberQunit) {
(0, _emberQunit.moduleForModel)('user', 'Unit | Model | user', {
// Specify the other units that are required for this test.
needs: []
});
(0, _emberQunit.test)('it exists', function (assert) {
var model = this.subject();
// let store = this.store();
assert.ok(!!model);
});
});
define('muffin/tests/unit/routes/index-test', ['exports', 'ember-qunit'], function (exports, _emberQunit) {
(0, _emberQunit.moduleFor)('route:index', 'Unit | Route | index', {
// Specify the other units that are required for this test.
// needs: ['controller:foo']
});
(0, _emberQunit.test)('it exists', function (assert) {
var route = this.subject();
assert.ok(route);
});
});
define('muffin/tests/unit/routes/login-test', ['exports', 'ember-qunit'], function (exports, _emberQunit) {
(0, _emberQunit.moduleFor)('route:login', 'Unit | Route | login', {
// Specify the other units that are required for this test.
// needs: ['controller:foo']
});
(0, _emberQunit.test)('it exists', function (assert) {
var route = this.subject();
assert.ok(route);
});
});
define('muffin/tests/unit/routes/media-test', ['exports', 'ember-qunit'], function (exports, _emberQunit) {
(0, _emberQunit.moduleFor)('route:media', 'Unit | Route | media', {
// Specify the other units that are required for this test.
// needs: ['controller:foo']
});
(0, _emberQunit.test)('it exists', function (assert) {
var route = this.subject();
assert.ok(route);
});
});
define('muffin/tests/unit/routes/pages/edit-test', ['exports', 'ember-qunit'], function (exports, _emberQunit) {
(0, _emberQunit.moduleFor)('route:pages/edit', 'Unit | Route | pages/edit', {
// Specify the other units that are required for this test.
// needs: ['controller:foo']
});
(0, _emberQunit.test)('it exists', function (assert) {
var route = this.subject();
assert.ok(route);
});
});
define('muffin/tests/unit/routes/pages/index-test', ['exports', 'ember-qunit'], function (exports, _emberQunit) {
(0, _emberQunit.moduleFor)('route:pages/index', 'Unit | Route | pages/index', {
// Specify the other units that are required for this test.
// needs: ['controller:foo']
});
(0, _emberQunit.test)('it exists', function (assert) {
var route = this.subject();
assert.ok(route);
});
});
define('muffin/tests/unit/routes/reset-password-test', ['exports', 'ember-qunit'], function (exports, _emberQunit) {
(0, _emberQunit.moduleFor)('route:reset-password', 'Unit | Route | reset password', {
// Specify the other units that are required for this test.
// needs: ['controller:foo']
});
(0, _emberQunit.test)('it exists', function (assert) {
var route = this.subject();
assert.ok(route);
});
});
define('muffin/tests/unit/routes/users/edit-test', ['exports', 'ember-qunit'], function (exports, _emberQunit) {
(0, _emberQunit.moduleFor)('route:users/edit', 'Unit | Route | users/edit', {
// Specify the other units that are required for this test.
// needs: ['controller:foo']
});
(0, _emberQunit.test)('it exists', function (assert) {
var route = this.subject();
assert.ok(route);
});
});
define('muffin/tests/unit/routes/users/index-test', ['exports', 'ember-qunit'], function (exports, _emberQunit) {
(0, _emberQunit.moduleFor)('route:users/index', 'Unit | Route | users/index', {
// Specify the other units that are required for this test.
// needs: ['controller:foo']
});
(0, _emberQunit.test)('it exists', function (assert) {
var route = this.subject();
assert.ok(route);
});
});
/* jshint ignore:start */
require('muffin/tests/test-helper');
EmberENV.TESTS_FILE_LOADED = true;
/* jshint ignore:end */