Global injection
This commit is contained in:
parent
c70dd933c5
commit
559c0a3d9f
9 changed files with 76 additions and 9 deletions
23
tests/unit/initializers/global-variables-test.js
Normal file
23
tests/unit/initializers/global-variables-test.js
Normal file
|
@ -0,0 +1,23 @@
|
|||
import Ember from 'ember';
|
||||
import { initialize } from '../../../initializers/global-variables';
|
||||
import { module, test } from 'qunit';
|
||||
|
||||
var container, application;
|
||||
|
||||
module('Unit | Initializer | global variables', {
|
||||
beforeEach: function() {
|
||||
Ember.run(function() {
|
||||
application = Ember.Application.create();
|
||||
container = application.__container__;
|
||||
application.deferReadiness();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Replace this with your real tests.
|
||||
test('it works', function(assert) {
|
||||
initialize(container, application);
|
||||
|
||||
// you would normally confirm the results of the initializer here
|
||||
assert.ok(true);
|
||||
});
|
19
tests/unit/pods/components/site-name/component-test.js
Normal file
19
tests/unit/pods/components/site-name/component-test.js
Normal file
|
@ -0,0 +1,19 @@
|
|||
import { moduleForComponent, test } from 'ember-qunit';
|
||||
|
||||
moduleForComponent('site-name', 'Unit | Component | site name', {
|
||||
// Specify the other units that are required for this test
|
||||
// needs: ['component:foo', 'helper:bar'],
|
||||
unit: true
|
||||
});
|
||||
|
||||
test('it renders', function(assert) {
|
||||
assert.expect(2);
|
||||
|
||||
// Creates the component instance
|
||||
var component = this.subject();
|
||||
assert.equal(component._state, 'preRender');
|
||||
|
||||
// Renders the component to the page
|
||||
this.render();
|
||||
assert.equal(component._state, 'inDOM');
|
||||
});
|
Reference in a new issue