ember-source 4.5.0-alpha.4 → 4.5.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -4
- package/blueprints-js/-addon-import.js +48 -0
- package/blueprints-js/acceptance-test/mocha-files/tests/acceptance/__name__-test.js +24 -0
- package/blueprints-js/acceptance-test/mocha-rfc-232-files/tests/acceptance/__name__-test.js +13 -0
- package/blueprints-js/acceptance-test/qunit-files/tests/acceptance/__name__-test.js +12 -0
- package/blueprints-js/acceptance-test/qunit-rfc-232-files/tests/acceptance/__name__-test.js +13 -0
- package/blueprints-js/component/files/__root__/__path__/__name__.js +3 -0
- package/blueprints-js/component/files/__root__/__templatepath__/__templatename__.hbs +1 -0
- package/blueprints-js/component-addon/files/__root__/__path__/__name__.js +1 -0
- package/blueprints-js/component-class/files/__root__/__path__/__name__.js +3 -0
- package/blueprints-js/component-class-addon/files/__root__/__path__/__name__.js +1 -0
- package/blueprints-js/component-test/mocha-0.12-files/__root__/__testType__/__path__/__test__.js +34 -0
- package/blueprints-js/component-test/mocha-files/__root__/__testType__/__path__/__test__.js +36 -0
- package/blueprints-js/component-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js +38 -0
- package/blueprints-js/component-test/qunit-files/__root__/__testType__/__path__/__test__.js +31 -0
- package/blueprints-js/component-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js +36 -0
- package/blueprints-js/controller/files/__root__/__path__/__name__.js +3 -0
- package/blueprints-js/controller-test/mocha-0.12-files/__root__/__testType__/__path__/__test__.js +16 -0
- package/blueprints-js/controller-test/mocha-files/__root__/__testType__/__path__/__test__.js +18 -0
- package/blueprints-js/controller-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js +13 -0
- package/blueprints-js/controller-test/qunit-files/__root__/__testType__/__path__/__test__.js +12 -0
- package/blueprints-js/controller-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js +12 -0
- package/blueprints-js/helper/files/__root__/__collection__/__name__.js +5 -0
- package/blueprints-js/helper/mu-files/__root__/__collection__/__name__.js +7 -0
- package/blueprints-js/helper-addon/files/__root__/__path__/__name__.js +1 -0
- package/blueprints-js/helper-test/mocha-0.12-files/__root__/__testType__/__collection__/__name__-test.js +26 -0
- package/blueprints-js/helper-test/mocha-files/__root__/__testType__/__collection__/__name__-test.js +28 -0
- package/blueprints-js/helper-test/mocha-rfc-232-files/__root__/__testType__/__collection__/__name__-test.js +18 -0
- package/blueprints-js/helper-test/qunit-files/__root__/__testType__/__collection__/__name__-test.js +15 -0
- package/blueprints-js/helper-test/qunit-rfc-232-files/__root__/__testType__/__collection__/__name__-test.js +17 -0
- package/blueprints-js/initializer/files/__root__/initializers/__name__.js +5 -0
- package/blueprints-js/initializer-addon/files/__root__/__path__/__name__.js +1 -0
- package/blueprints-js/initializer-test/mocha-files/__root__/__testType__/__path__/__name__-test.js +28 -0
- package/blueprints-js/initializer-test/mocha-rfc-232-files/__root__/__testType__/__path__/__name__-test.js +31 -0
- package/blueprints-js/initializer-test/qunit-files/__root__/__testType__/__path__/__name__-test.js +25 -0
- package/blueprints-js/initializer-test/qunit-rfc-232-files/__root__/__testType__/__path__/__name__-test.js +37 -0
- package/blueprints-js/instance-initializer/files/__root__/instance-initializers/__name__.js +5 -0
- package/blueprints-js/instance-initializer-addon/files/__root__/__path__/__name__.js +1 -0
- package/blueprints-js/instance-initializer-test/mocha-files/__root__/__testType__/__path__/__name__-test.js +30 -0
- package/blueprints-js/instance-initializer-test/mocha-rfc-232-files/__root__/__testType__/__path__/__name__-test.js +32 -0
- package/blueprints-js/instance-initializer-test/qunit-files/__root__/__testType__/__path__/__name__-test.js +26 -0
- package/blueprints-js/instance-initializer-test/qunit-rfc-232-files/__root__/__testType__/__path__/__name__-test.js +39 -0
- package/blueprints-js/mixin/files/__root__/mixins/__name__.js +3 -0
- package/blueprints-js/mixin-test/mocha-files/__root__/__testType__/__name__-test.js +13 -0
- package/blueprints-js/mixin-test/mocha-rfc-232-files/__root__/__testType__/__name__-test.js +13 -0
- package/blueprints-js/mixin-test/qunit-files/__root__/__testType__/__name__-test.js +12 -0
- package/blueprints-js/mixin-test/qunit-rfc-232-files/__root__/__testType__/__name__-test.js +12 -0
- package/blueprints-js/route/files/__root__/__path__/__name__.js +9 -0
- package/blueprints-js/route/files/__root__/__templatepath__/__templatename__.hbs +2 -0
- package/blueprints-js/route-addon/files/__root__/__path__/__name__.js +1 -0
- package/blueprints-js/route-addon/files/__root__/__templatepath__/__templatename__.js +1 -0
- package/blueprints-js/route-test/mocha-0.12-files/__root__/__testType__/__path__/__test__.js +15 -0
- package/blueprints-js/route-test/mocha-files/__root__/__testType__/__path__/__test__.js +17 -0
- package/blueprints-js/route-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js +12 -0
- package/blueprints-js/route-test/qunit-files/__root__/__testType__/__path__/__test__.js +11 -0
- package/blueprints-js/route-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js +11 -0
- package/blueprints-js/service/files/__root__/__path__/__name__.js +3 -0
- package/blueprints-js/service-test/mocha-0.12-files/__root__/__testType__/__path__/__test__.js +16 -0
- package/blueprints-js/service-test/mocha-files/__root__/__testType__/__path__/__test__.js +18 -0
- package/blueprints-js/service-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js +13 -0
- package/blueprints-js/service-test/qunit-files/__root__/__testType__/__path__/__test__.js +12 -0
- package/blueprints-js/service-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js +12 -0
- package/blueprints-js/template/files/__root__/__path__/__name__.hbs +0 -0
- package/blueprints-js/test-framework-detector.js +60 -0
- package/blueprints-js/util/files/__root__/utils/__name__.js +3 -0
- package/blueprints-js/util-test/mocha-files/__root__/__testType__/__name__-test.js +11 -0
- package/blueprints-js/util-test/mocha-rfc-232-files/__root__/__testType__/__name__-test.js +11 -0
- package/blueprints-js/util-test/qunit-files/__root__/__testType__/__name__-test.js +10 -0
- package/blueprints-js/util-test/qunit-rfc-232-files/__root__/__testType__/__name__-test.js +10 -0
- package/build-metadata.json +3 -3
- package/dist/ember-template-compiler.js +12 -5
- package/dist/ember-template-compiler.map +1 -1
- package/dist/ember-testing.js +1 -1
- package/dist/ember-testing.map +1 -1
- package/dist/ember.debug.js +722 -1001
- package/dist/ember.debug.map +1 -1
- package/dist/header/license.js +1 -1
- package/dist/packages/@ember/-internals/container/index.js +2 -2
- package/dist/packages/@ember/-internals/glimmer/index.js +33 -23
- package/dist/packages/@ember/-internals/metal/index.js +19 -7
- package/dist/packages/@ember/-internals/routing/lib/location/api.js +3 -3
- package/dist/packages/@ember/-internals/routing/lib/location/auto_location.js +5 -1
- package/dist/packages/@ember/-internals/routing/lib/services/router.js +7 -6
- package/dist/packages/@ember/-internals/routing/lib/services/routing.js +9 -6
- package/dist/packages/@ember/-internals/routing/lib/system/route.js +6 -9
- package/dist/packages/@ember/-internals/routing/lib/system/router.js +4 -2
- package/dist/packages/@ember/-internals/routing/lib/utils.js +15 -25
- package/dist/packages/@ember/-internals/runtime/lib/compare.js +4 -1
- package/dist/packages/@ember/-internals/runtime/lib/mixins/-proxy.js +14 -15
- package/dist/packages/@ember/-internals/runtime/lib/mixins/action_handler.js +32 -44
- package/dist/packages/@ember/-internals/runtime/lib/mixins/array.js +1 -1
- package/dist/packages/@ember/-internals/runtime/lib/mixins/comparable.js +7 -22
- package/dist/packages/@ember/-internals/runtime/lib/mixins/container_proxy.js +34 -46
- package/dist/packages/@ember/-internals/runtime/lib/mixins/enumerable.js +2 -15
- package/dist/packages/@ember/-internals/runtime/lib/mixins/evented.js +13 -57
- package/dist/packages/@ember/-internals/runtime/lib/mixins/mutable_enumerable.js +2 -16
- package/dist/packages/@ember/-internals/runtime/lib/mixins/observable.js +64 -134
- package/dist/packages/@ember/-internals/runtime/lib/mixins/promise_proxy.js +28 -86
- package/dist/packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js +59 -61
- package/dist/packages/@ember/-internals/runtime/lib/mixins/target_action_support.js +17 -24
- package/dist/packages/@ember/-internals/runtime/lib/system/array_proxy.js +59 -85
- package/dist/packages/@ember/-internals/runtime/lib/system/object.js +9 -2
- package/dist/packages/@ember/-internals/runtime/lib/system/object_proxy.js +3 -77
- package/dist/packages/@ember/-internals/utils/index.js +1 -1
- package/dist/packages/@ember/-internals/utils/types.js +1 -0
- package/dist/packages/@ember/-internals/views/lib/compat/attrs.js +1 -2
- package/dist/packages/@ember/-internals/views/lib/component_lookup.js +2 -2
- package/dist/packages/@ember/-internals/views/lib/mixins/action_support.js +3 -9
- package/dist/packages/@ember/-internals/views/lib/mixins/child_views_support.js +4 -6
- package/dist/packages/@ember/-internals/views/lib/mixins/class_names_support.js +13 -18
- package/dist/packages/@ember/-internals/views/lib/mixins/view_state_support.js +3 -2
- package/dist/packages/@ember/-internals/views/lib/mixins/view_support.js +57 -58
- package/dist/packages/@ember/-internals/views/lib/system/event_dispatcher.js +142 -120
- package/dist/packages/@ember/-internals/views/lib/system/utils.js +1 -1
- package/dist/packages/@ember/-internals/views/lib/views/states/destroying.js +1 -1
- package/dist/packages/@ember/-internals/views/lib/views/states/has_element.js +2 -2
- package/dist/packages/@ember/-internals/views/lib/views/states/in_dom.js +3 -1
- package/dist/packages/@ember/application/instance.js +1 -0
- package/dist/packages/@ember/application/lib/application.js +8 -1
- package/dist/packages/@ember/canary-features/index.js +2 -2
- package/dist/packages/@ember/engine/instance.js +1 -1
- package/dist/packages/@ember/engine/lib/engine-parent.js +1 -5
- package/dist/packages/@ember/renderer/index.js +28 -0
- package/dist/packages/ember/version.js +1 -1
- package/docs/data.json +838 -712
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
# Ember
|
|
1
|
+
# Ember Changelog
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
### v4.5.0-beta.2 (June 6, 2022)
|
|
4
4
|
|
|
5
|
-
- [#
|
|
5
|
+
- [#20082](https://github.com/emberjs/ember.js/pull/20082) [BUGFIX] Fix blueprint generation
|
|
6
|
+
|
|
7
|
+
### v4.5.0-beta.1 (May 2, 2022)
|
|
8
|
+
|
|
9
|
+
- [#20052](https://github.com/emberjs/ember.js/pull/20052) / [#20055](https://github.com/emberjs/ember.js/pull/20055) [FEATURE] Add the default helper manager to implement [RFC #0756](https://github.com/emberjs/rfcs/blob/master/text/0756-helper-default-manager.md).
|
|
10
|
+
- [#20053](https://github.com/emberjs/ember.js/pull/20053) [FEATURE] Expose `renderSettled` from `@ember/renderer` to enable implementation of [RFC #0785](https://github.com/emberjs/rfcs/blob/master/text/0785-remove-set-get-in-tests.md).
|
|
6
11
|
|
|
7
|
-
### v4.4.0
|
|
12
|
+
### v4.4.0 (May 2, 2022)
|
|
8
13
|
|
|
9
14
|
- [#19882](https://github.com/emberjs/ember.js/pull/19882) / [#20005](https://github.com/emberjs/ember.js/pull/20005) [FEATURE] Implement the `unique-id` helper per [RFC #0659](https://github.com/emberjs/rfcs/blob/master/text/0659-unique-id-helper.md).
|
|
10
15
|
- [#19981](https://github.com/emberjs/ember.js/pull/19981) [FEATURE] Facilitate custom test setups per [RFC #0637](https://github.com/emberjs/rfcs/blob/master/text/0637-customizable-test-setups.md).
|
|
@@ -12,6 +17,10 @@
|
|
|
12
17
|
- [#17978](https://github.com/emberjs/ember.js/pull/17978) Make hasListeners public
|
|
13
18
|
- [#20014](https://github.com/emberjs/ember.js/pull/20014) Log `until` for deprecations
|
|
14
19
|
|
|
20
|
+
### v3.28.9 (April 19, 2022)
|
|
21
|
+
|
|
22
|
+
- [#20028](https://github.com/emberjs/ember.js/pull/20028) Fix a memory leak in the Router Service class
|
|
23
|
+
|
|
15
24
|
### v4.3.0 (March 21, 2022)
|
|
16
25
|
|
|
17
26
|
- [#20025](https://github.com/emberjs/ember.js/pull/20025) [BUGFIX] Fix a memory leak in the Router Service class
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const stringUtil = require('ember-cli-string-utils');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const inflector = require('inflection');
|
|
6
|
+
|
|
7
|
+
module.exports = {
|
|
8
|
+
description: 'Generates an import wrapper.',
|
|
9
|
+
|
|
10
|
+
fileMapTokens: function () {
|
|
11
|
+
return {
|
|
12
|
+
__name__: function (options) {
|
|
13
|
+
return options.dasherizedModuleName;
|
|
14
|
+
},
|
|
15
|
+
__path__: function (options) {
|
|
16
|
+
return inflector.pluralize(options.locals.blueprintName);
|
|
17
|
+
},
|
|
18
|
+
__root__: function (options) {
|
|
19
|
+
if (options.inRepoAddon) {
|
|
20
|
+
return path.join('lib', options.inRepoAddon, 'app');
|
|
21
|
+
}
|
|
22
|
+
return 'app';
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
locals: function (options) {
|
|
28
|
+
let addonRawName = options.inRepoAddon ? options.inRepoAddon : options.project.name();
|
|
29
|
+
let addonName = stringUtil.dasherize(addonRawName);
|
|
30
|
+
let fileName = stringUtil.dasherize(options.entity.name);
|
|
31
|
+
let blueprintName = options.originBlueprintName;
|
|
32
|
+
let modulePathSegments = [
|
|
33
|
+
addonName,
|
|
34
|
+
inflector.pluralize(options.originBlueprintName),
|
|
35
|
+
fileName,
|
|
36
|
+
];
|
|
37
|
+
|
|
38
|
+
if (blueprintName.match(/-addon/)) {
|
|
39
|
+
blueprintName = blueprintName.substr(0, blueprintName.indexOf('-addon'));
|
|
40
|
+
modulePathSegments = [addonName, inflector.pluralize(blueprintName), fileName];
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return {
|
|
44
|
+
modulePath: modulePathSegments.join('/'),
|
|
45
|
+
blueprintName: blueprintName,
|
|
46
|
+
};
|
|
47
|
+
},
|
|
48
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { describe, it, beforeEach, afterEach } from 'mocha';
|
|
2
|
+
import { expect } from 'chai';
|
|
3
|
+
import startApp from '<%= dasherizedPackageName %>/tests/helpers/start-app';
|
|
4
|
+
<% if (destroyAppExists) { %>import destroyApp from '<%= dasherizedPackageName %>/tests/helpers/destroy-app';<% } else { %>import { run } from '@ember/runloop';<% } %>
|
|
5
|
+
|
|
6
|
+
describe('<%= friendlyTestName %>', function () {
|
|
7
|
+
let application;
|
|
8
|
+
|
|
9
|
+
beforeEach(function () {
|
|
10
|
+
application = startApp();
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
afterEach(function () {
|
|
14
|
+
<% if (destroyAppExists) { %>destroyApp(application);<% } else { %>run(application, 'destroy');<% } %>
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it('can visit /<%= dasherizedModuleName %>', function () {
|
|
18
|
+
visit('/<%= dasherizedModuleName %>');
|
|
19
|
+
|
|
20
|
+
return andThen(() => {
|
|
21
|
+
expect(currentURL()).to.equal('/<%= dasherizedModuleName %>');
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { describe, it } from 'mocha';
|
|
2
|
+
import { expect } from 'chai';
|
|
3
|
+
import { setupApplicationTest } from '<%= dasherizedPackageName %>/tests/helpers';
|
|
4
|
+
import { visit, currentURL } from '@ember/test-helpers';
|
|
5
|
+
|
|
6
|
+
describe('<%= friendlyTestName %>', function () {
|
|
7
|
+
setupApplicationTest();
|
|
8
|
+
|
|
9
|
+
it('can visit /<%= dasherizedModuleName %>', async function () {
|
|
10
|
+
await visit('/<%= dasherizedModuleName %>');
|
|
11
|
+
expect(currentURL()).to.equal('/<%= dasherizedModuleName %>');
|
|
12
|
+
});
|
|
13
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { test } from 'qunit';
|
|
2
|
+
import moduleForAcceptance from '<%= testFolderRoot %>/tests/helpers/module-for-acceptance';
|
|
3
|
+
|
|
4
|
+
moduleForAcceptance('<%= friendlyTestName %>');
|
|
5
|
+
|
|
6
|
+
test('visiting /<%= dasherizedModuleName %>', function (assert) {
|
|
7
|
+
visit('/<%= dasherizedModuleName %>');
|
|
8
|
+
|
|
9
|
+
andThen(function () {
|
|
10
|
+
assert.strictEqual(currentURL(), '/<%= dasherizedModuleName %>');
|
|
11
|
+
});
|
|
12
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { module, test } from 'qunit';
|
|
2
|
+
import { visit, currentURL } from '@ember/test-helpers';
|
|
3
|
+
import { setupApplicationTest } from '<%= dasherizedPackageName %>/tests/helpers';
|
|
4
|
+
|
|
5
|
+
module('<%= friendlyTestName %>', function (hooks) {
|
|
6
|
+
setupApplicationTest(hooks);
|
|
7
|
+
|
|
8
|
+
test('visiting /<%= dasherizedModuleName %>', async function (assert) {
|
|
9
|
+
await visit('/<%= dasherizedModuleName %>');
|
|
10
|
+
|
|
11
|
+
assert.strictEqual(currentURL(), '/<%= dasherizedModuleName %>');
|
|
12
|
+
});
|
|
13
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{{yield}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '<%= modulePath %>';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '<%= modulePath %>';
|
package/blueprints-js/component-test/mocha-0.12-files/__root__/__testType__/__path__/__test__.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { expect } from 'chai';
|
|
2
|
+
import { describe, it } from 'mocha';
|
|
3
|
+
import { setupComponentTest } from 'ember-mocha';<% if (testType === 'integration') { %>
|
|
4
|
+
import hbs from 'htmlbars-inline-precompile';<% } %>
|
|
5
|
+
|
|
6
|
+
describe('<%= friendlyTestDescription %>', function () {
|
|
7
|
+
setupComponentTest('<%= componentPathName %>', {
|
|
8
|
+
<% if (testType === 'integration' ) { %>integration: true,<% } else if(testType === 'unit') { %>// Specify the other units that are required for this test
|
|
9
|
+
// needs: ['component:foo', 'helper:bar'],
|
|
10
|
+
unit: true,<% } %>
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it('renders', function () {
|
|
14
|
+
<% if (testType === 'integration' ) { %>// Set any properties with this.set('myProperty', 'value');
|
|
15
|
+
// Handle any actions with this.on('myAction', function(val) { ... });
|
|
16
|
+
|
|
17
|
+
this.render(hbs`<%= selfCloseComponent(componentName) %>`);
|
|
18
|
+
expect(this.$()).to.have.length(1);
|
|
19
|
+
|
|
20
|
+
// Template block usage:
|
|
21
|
+
this.render(hbs`
|
|
22
|
+
<%= openComponent(componentName) %>
|
|
23
|
+
template block text
|
|
24
|
+
<%= closeComponent(componentName) %>
|
|
25
|
+
`);
|
|
26
|
+
|
|
27
|
+
expect(this.$().text().trim()).to.equal('template block text');<% } else if(testType === 'unit') { %>// creates the component instance
|
|
28
|
+
let component = this.subject();
|
|
29
|
+
// renders the component on the page
|
|
30
|
+
this.render();
|
|
31
|
+
expect(component).to.be.ok;
|
|
32
|
+
expect(this.$()).to.have.length(1);<% } %>
|
|
33
|
+
});
|
|
34
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { expect } from 'chai';
|
|
2
|
+
import { describeComponent, it } from 'ember-mocha';<% if (testType === 'integration') { %>
|
|
3
|
+
import hbs from 'htmlbars-inline-precompile';<% } %>
|
|
4
|
+
|
|
5
|
+
describeComponent(
|
|
6
|
+
'<%= componentPathName %>',
|
|
7
|
+
'<%= friendlyTestDescription %>',
|
|
8
|
+
{
|
|
9
|
+
<% if (testType === 'integration' ) { %>integration: true,<% } else if(testType === 'unit') { %>// Specify the other units that are required for this test
|
|
10
|
+
// needs: ['component:foo', 'helper:bar'],
|
|
11
|
+
unit: true,<% } %>
|
|
12
|
+
},
|
|
13
|
+
function () {
|
|
14
|
+
it('renders', function () {
|
|
15
|
+
<% if (testType === 'integration' ) { %>// Set any properties with this.set('myProperty', 'value');
|
|
16
|
+
// Handle any actions with this.on('myAction', function(val) { ... });
|
|
17
|
+
|
|
18
|
+
this.render(hbs`<%= selfCloseComponent(componentName) %>`);
|
|
19
|
+
expect(this.$()).to.have.length(1);
|
|
20
|
+
|
|
21
|
+
// Template block usage:
|
|
22
|
+
this.render(hbs`
|
|
23
|
+
<%= openComponent(componentName) %>
|
|
24
|
+
template block text
|
|
25
|
+
<%= closeComponent(componentName) %>
|
|
26
|
+
`);
|
|
27
|
+
|
|
28
|
+
expect(this.$().text().trim()).to.equal('template block text');<% } else if(testType === 'unit') { %>// creates the component instance
|
|
29
|
+
let component = this.subject();
|
|
30
|
+
// renders the component on the page
|
|
31
|
+
this.render();
|
|
32
|
+
expect(component).to.be.ok;
|
|
33
|
+
expect(this.$()).to.have.length(1);<% } %>
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
);
|
package/blueprints-js/component-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<% if (testType === 'integration') { %>import { expect } from 'chai';
|
|
2
|
+
import { describe, it } from 'mocha';
|
|
3
|
+
import { setupRenderingTest } from '<%= dasherizedPackageName %>/tests/helpers';
|
|
4
|
+
import { render } from '@ember/test-helpers';
|
|
5
|
+
<%= hbsImportStatement %>
|
|
6
|
+
|
|
7
|
+
describe('<%= friendlyTestDescription %>', function () {
|
|
8
|
+
setupRenderingTest();
|
|
9
|
+
|
|
10
|
+
it('renders', async function () {
|
|
11
|
+
// Set any properties with this.set('myProperty', 'value');
|
|
12
|
+
// Handle any actions with this.set('myAction', function(val) { ... });
|
|
13
|
+
|
|
14
|
+
await render(hbs`<%= selfCloseComponent(componentName) %>`);
|
|
15
|
+
|
|
16
|
+
expect(this.element.textContent.trim()).to.equal('');
|
|
17
|
+
|
|
18
|
+
// Template block usage:
|
|
19
|
+
await render(hbs`
|
|
20
|
+
<%= openComponent(componentName) %>
|
|
21
|
+
template block text
|
|
22
|
+
<%= closeComponent(componentName) %>
|
|
23
|
+
`);
|
|
24
|
+
|
|
25
|
+
expect(this.element.textContent.trim()).to.equal('template block text');
|
|
26
|
+
});
|
|
27
|
+
});<% } else if (testType === 'unit') { %>import { expect } from 'chai';
|
|
28
|
+
import { describe, it } from 'mocha';
|
|
29
|
+
import { setupTest } from '<%= dasherizedPackageName %>/tests/helpers';
|
|
30
|
+
|
|
31
|
+
describe('<%= friendlyTestDescription %>', function () {
|
|
32
|
+
setupTest();
|
|
33
|
+
|
|
34
|
+
it('exists', function () {
|
|
35
|
+
let component = this.owner.factoryFor('component:<%= componentPathName %>').create();
|
|
36
|
+
expect(component).to.be.ok;
|
|
37
|
+
});
|
|
38
|
+
});<% } %>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { moduleForComponent, test } from 'ember-qunit';<% if (testType === 'integration') { %>
|
|
2
|
+
import hbs from 'htmlbars-inline-precompile';<% } %>
|
|
3
|
+
|
|
4
|
+
moduleForComponent('<%= componentPathName %>', '<%= friendlyTestDescription %>', {
|
|
5
|
+
<% if (testType === 'integration' ) { %>integration: true,<% } else if(testType === 'unit') { %>// Specify the other units that are required for this test
|
|
6
|
+
// needs: ['component:foo', 'helper:bar'],
|
|
7
|
+
unit: true,<% } %>
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
test('it renders', function (assert) {<% if (testType === 'integration' ) { %>
|
|
11
|
+
// Set any properties with this.set('myProperty', 'value');
|
|
12
|
+
// Handle any actions with this.on('myAction', function(val) { ... });
|
|
13
|
+
|
|
14
|
+
this.render(hbs`<%= selfCloseComponent(componentName) %>`);
|
|
15
|
+
|
|
16
|
+
assert.strictEqual(this.$().text().trim(), '');
|
|
17
|
+
|
|
18
|
+
// Template block usage:
|
|
19
|
+
this.render(hbs`
|
|
20
|
+
<%= openComponent(componentName) %>
|
|
21
|
+
template block text
|
|
22
|
+
<%= closeComponent(componentName) %>
|
|
23
|
+
`);
|
|
24
|
+
|
|
25
|
+
assert.strictEqual(this.$().text().trim(), 'template block text');<% } else if(testType === 'unit') { %>
|
|
26
|
+
// Creates the component instance
|
|
27
|
+
/*let component =*/ this.subject();
|
|
28
|
+
// Renders the component to the page
|
|
29
|
+
this.render();
|
|
30
|
+
assert.strictEqual(this.$().text().trim(), '');<% } %>
|
|
31
|
+
});
|
package/blueprints-js/component-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<% if (testType === 'integration') { %>import { module, test } from 'qunit';
|
|
2
|
+
import { setupRenderingTest } from '<%= dasherizedPackageName %>/tests/helpers';
|
|
3
|
+
import { render } from '@ember/test-helpers';
|
|
4
|
+
<%= hbsImportStatement %>
|
|
5
|
+
|
|
6
|
+
module('<%= friendlyTestDescription %>', function (hooks) {
|
|
7
|
+
setupRenderingTest(hooks);
|
|
8
|
+
|
|
9
|
+
test('it renders', async function (assert) {
|
|
10
|
+
// Set any properties with this.set('myProperty', 'value');
|
|
11
|
+
// Handle any actions with this.set('myAction', function(val) { ... });
|
|
12
|
+
|
|
13
|
+
await render(hbs`<%= selfCloseComponent(componentName) %>`);
|
|
14
|
+
|
|
15
|
+
assert.dom(this.element).hasText('');
|
|
16
|
+
|
|
17
|
+
// Template block usage:
|
|
18
|
+
await render(hbs`
|
|
19
|
+
<%= openComponent(componentName) %>
|
|
20
|
+
template block text
|
|
21
|
+
<%= closeComponent(componentName) %>
|
|
22
|
+
`);
|
|
23
|
+
|
|
24
|
+
assert.dom(this.element).hasText('template block text');
|
|
25
|
+
});
|
|
26
|
+
});<% } else if (testType === 'unit') { %>import { module, test } from 'qunit';
|
|
27
|
+
import { setupTest } from '<%= dasherizedPackageName %>/tests/helpers';
|
|
28
|
+
|
|
29
|
+
module('<%= friendlyTestDescription %>', function (hooks) {
|
|
30
|
+
setupTest(hooks);
|
|
31
|
+
|
|
32
|
+
test('it exists', function (assert) {
|
|
33
|
+
let component = this.owner.factoryFor('component:<%= componentPathName %>').create();
|
|
34
|
+
assert.ok(component);
|
|
35
|
+
});
|
|
36
|
+
});<% } %>
|
package/blueprints-js/controller-test/mocha-0.12-files/__root__/__testType__/__path__/__test__.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { expect } from 'chai';
|
|
2
|
+
import { describe, it } from 'mocha';
|
|
3
|
+
import { setupTest } from 'ember-mocha';
|
|
4
|
+
|
|
5
|
+
describe('<%= friendlyTestDescription %>', function () {
|
|
6
|
+
setupTest('controller:<%= dasherizedModuleName %>', {
|
|
7
|
+
// Specify the other units that are required for this test.
|
|
8
|
+
// needs: ['controller:foo']
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
// TODO: Replace this with your real tests.
|
|
12
|
+
it('exists', function () {
|
|
13
|
+
let controller = this.subject();
|
|
14
|
+
expect(controller).to.be.ok;
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { expect } from 'chai';
|
|
2
|
+
import { describeModule, it } from 'ember-mocha';
|
|
3
|
+
|
|
4
|
+
describeModule(
|
|
5
|
+
'controller:<%= dasherizedModuleName %>',
|
|
6
|
+
'<%= friendlyTestDescription %>',
|
|
7
|
+
{
|
|
8
|
+
// Specify the other units that are required for this test.
|
|
9
|
+
// needs: ['controller:foo']
|
|
10
|
+
},
|
|
11
|
+
function () {
|
|
12
|
+
// TODO: Replace this with your real tests.
|
|
13
|
+
it('exists', function () {
|
|
14
|
+
let controller = this.subject();
|
|
15
|
+
expect(controller).to.be.ok;
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
);
|
package/blueprints-js/controller-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { expect } from 'chai';
|
|
2
|
+
import { describe, it } from 'mocha';
|
|
3
|
+
import { setupTest } from '<%= dasherizedPackageName %>/tests/helpers';
|
|
4
|
+
|
|
5
|
+
describe('<%= friendlyTestDescription %>', function () {
|
|
6
|
+
setupTest();
|
|
7
|
+
|
|
8
|
+
// TODO: Replace this with your real tests.
|
|
9
|
+
it('exists', function () {
|
|
10
|
+
let controller = this.owner.lookup('controller:<%= controllerPathName %>');
|
|
11
|
+
expect(controller).to.be.ok;
|
|
12
|
+
});
|
|
13
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { moduleFor, test } from 'ember-qunit';
|
|
2
|
+
|
|
3
|
+
moduleFor('controller:<%= dasherizedModuleName %>', '<%= friendlyTestDescription %>', {
|
|
4
|
+
// Specify the other units that are required for this test.
|
|
5
|
+
// needs: ['controller:foo']
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
// TODO: Replace this with your real tests.
|
|
9
|
+
test('it exists', function (assert) {
|
|
10
|
+
let controller = this.subject();
|
|
11
|
+
assert.ok(controller);
|
|
12
|
+
});
|
package/blueprints-js/controller-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { module, test } from 'qunit';
|
|
2
|
+
import { setupTest } from '<%= dasherizedPackageName %>/tests/helpers';
|
|
3
|
+
|
|
4
|
+
module('<%= friendlyTestDescription %>', function (hooks) {
|
|
5
|
+
setupTest(hooks);
|
|
6
|
+
|
|
7
|
+
// TODO: Replace this with your real tests.
|
|
8
|
+
test('it exists', function (assert) {
|
|
9
|
+
let controller = this.owner.lookup('controller:<%= controllerPathName %>');
|
|
10
|
+
assert.ok(controller);
|
|
11
|
+
});
|
|
12
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '<%= modulePath %>';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { expect } from 'chai';
|
|
2
|
+
import { describe, it } from 'mocha';
|
|
3
|
+
import { setupComponentTest } from 'ember-mocha';
|
|
4
|
+
import hbs from 'htmlbars-inline-precompile';
|
|
5
|
+
|
|
6
|
+
describe('<%= friendlyTestName %>', function () {
|
|
7
|
+
setupComponentTest('<%= dasherizedModuleName %>', {
|
|
8
|
+
integration: true,
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
it('renders', function () {
|
|
12
|
+
// Set any properties with this.set('myProperty', 'value');
|
|
13
|
+
// Handle any actions with this.on('myAction', function(val) { ... });
|
|
14
|
+
// Template block usage:
|
|
15
|
+
// this.render(hbs`
|
|
16
|
+
// {{#<%= dasherizedModuleName %>}}
|
|
17
|
+
// template content
|
|
18
|
+
// {{/<%= dasherizedModuleName %>}}
|
|
19
|
+
// `);
|
|
20
|
+
this.set('inputValue', '1234');
|
|
21
|
+
|
|
22
|
+
this.render(hbs`{{<%= dasherizedModuleName %> this.inputValue}}`);
|
|
23
|
+
|
|
24
|
+
expect(this.$().text().trim()).to.equal('1234');
|
|
25
|
+
});
|
|
26
|
+
});
|
package/blueprints-js/helper-test/mocha-files/__root__/__testType__/__collection__/__name__-test.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { expect } from 'chai';
|
|
2
|
+
import { describeComponent, it } from 'ember-mocha';
|
|
3
|
+
import hbs from 'htmlbars-inline-precompile';
|
|
4
|
+
|
|
5
|
+
describeComponent(
|
|
6
|
+
'<%= dasherizedModuleName %>',
|
|
7
|
+
'helper:<%= dasherizedModuleName %>',
|
|
8
|
+
{
|
|
9
|
+
integration: true,
|
|
10
|
+
},
|
|
11
|
+
function () {
|
|
12
|
+
it('renders', function () {
|
|
13
|
+
// Set any properties with this.set('myProperty', 'value');
|
|
14
|
+
// Handle any actions with this.on('myAction', function(val) { ... });
|
|
15
|
+
// Template block usage:
|
|
16
|
+
// this.render(hbs`
|
|
17
|
+
// {{#<%= dasherizedModuleName %>}}
|
|
18
|
+
// template content
|
|
19
|
+
// {{/<%= dasherizedModuleName %>}}
|
|
20
|
+
// `);
|
|
21
|
+
this.set('inputValue', '1234');
|
|
22
|
+
|
|
23
|
+
this.render(hbs`{{<%= dasherizedModuleName %> this.inputValue}}`);
|
|
24
|
+
|
|
25
|
+
expect(this.$().text().trim()).to.equal('1234');
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { expect } from 'chai';
|
|
2
|
+
import { describe, it } from 'mocha';
|
|
3
|
+
import { setupRenderingTest } from '<%= dasherizedPackageName %>/tests/helpers';
|
|
4
|
+
import { render } from '@ember/test-helpers';
|
|
5
|
+
<%= hbsImportStatement %>
|
|
6
|
+
|
|
7
|
+
describe('<%= friendlyTestName %>', function () {
|
|
8
|
+
setupRenderingTest();
|
|
9
|
+
|
|
10
|
+
// TODO: Replace this with your real tests.
|
|
11
|
+
it('renders', async function () {
|
|
12
|
+
this.set('inputValue', '1234');
|
|
13
|
+
|
|
14
|
+
await render(hbs`{{<%= dasherizedModuleName %> this.inputValue}}`);
|
|
15
|
+
|
|
16
|
+
expect(this.element.textContent.trim()).to.equal('1234');
|
|
17
|
+
});
|
|
18
|
+
});
|
package/blueprints-js/helper-test/qunit-files/__root__/__testType__/__collection__/__name__-test.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { moduleForComponent, test } from 'ember-qunit';
|
|
2
|
+
import hbs from 'htmlbars-inline-precompile';
|
|
3
|
+
|
|
4
|
+
moduleForComponent('<%= dasherizedModuleName %>', 'helper:<%= dasherizedModuleName %>', {
|
|
5
|
+
integration: true,
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
// TODO: Replace this with your real tests.
|
|
9
|
+
test('it renders', function (assert) {
|
|
10
|
+
this.set('inputValue', '1234');
|
|
11
|
+
|
|
12
|
+
this.render(hbs`{{<%= dasherizedModuleName %> this.inputValue}}`);
|
|
13
|
+
|
|
14
|
+
assert.strictEqual(this.$().text().trim(), '1234');
|
|
15
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { module, test } from 'qunit';
|
|
2
|
+
import { setupRenderingTest } from '<%= dasherizedPackageName %>/tests/helpers';
|
|
3
|
+
import { render } from '@ember/test-helpers';
|
|
4
|
+
<%= hbsImportStatement %>
|
|
5
|
+
|
|
6
|
+
module('<%= friendlyTestName %>', function (hooks) {
|
|
7
|
+
setupRenderingTest(hooks);
|
|
8
|
+
|
|
9
|
+
// TODO: Replace this with your real tests.
|
|
10
|
+
test('it renders', async function (assert) {
|
|
11
|
+
this.set('inputValue', '1234');
|
|
12
|
+
|
|
13
|
+
await render(hbs`{{<%= dasherizedModuleName %> this.inputValue}}`);
|
|
14
|
+
|
|
15
|
+
assert.dom(this.element).hasText('1234');
|
|
16
|
+
});
|
|
17
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default, initialize } from '<%= modulePath %>';
|
package/blueprints-js/initializer-test/mocha-files/__root__/__testType__/__path__/__name__-test.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { expect } from 'chai';
|
|
2
|
+
import { describe, it, beforeEach, afterEach } from 'mocha';
|
|
3
|
+
import { run } from '@ember/runloop';
|
|
4
|
+
import Application from '@ember/application';
|
|
5
|
+
import { initialize } from '<%= modulePrefix %>/initializers/<%= dasherizedModuleName %>';
|
|
6
|
+
<% if (destroyAppExists) { %>import destroyApp from '../../helpers/destroy-app';\n<% } %>
|
|
7
|
+
describe('<%= friendlyTestName %>', function () {
|
|
8
|
+
let application;
|
|
9
|
+
|
|
10
|
+
beforeEach(function () {
|
|
11
|
+
run(function () {
|
|
12
|
+
application = Application.create();
|
|
13
|
+
application.deferReadiness();
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
afterEach(function () {
|
|
18
|
+
<% if (destroyAppExists) { %>destroyApp(application);<% } else { %>run(application, 'destroy');<% } %>
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
// TODO: Replace this with your real tests.
|
|
22
|
+
it('works', function () {
|
|
23
|
+
initialize(application);
|
|
24
|
+
|
|
25
|
+
// you would normally confirm the results of the initializer here
|
|
26
|
+
expect(true).to.be.ok;
|
|
27
|
+
});
|
|
28
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { expect } from 'chai';
|
|
2
|
+
import { describe, it, beforeEach, afterEach } from 'mocha';
|
|
3
|
+
import Application from '@ember/application';
|
|
4
|
+
import { initialize } from '<%= modulePrefix %>/initializers/<%= dasherizedModuleName %>';
|
|
5
|
+
<% if (destroyAppExists) { %>import destroyApp from '../../helpers/destroy-app';<% } else { %>import { run } from '@ember/runloop';<% } %>
|
|
6
|
+
|
|
7
|
+
describe('<%= friendlyTestName %>', function () {
|
|
8
|
+
beforeEach(function () {
|
|
9
|
+
this.TestApplication = Application.extend();
|
|
10
|
+
this.TestApplication.initializer({
|
|
11
|
+
name: 'initializer under test',
|
|
12
|
+
initialize,
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
this.application = this.TestApplication.create({
|
|
16
|
+
autoboot: false,
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
afterEach(function () {
|
|
21
|
+
<% if (destroyAppExists) { %>destroyApp(this.application);<% } else { %>run(this.application, 'destroy');<% } %>
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
// TODO: Replace this with your real tests.
|
|
25
|
+
it('works', async function () {
|
|
26
|
+
await this.application.boot();
|
|
27
|
+
|
|
28
|
+
// you would normally confirm the results of the initializer here
|
|
29
|
+
expect(true).to.be.ok;
|
|
30
|
+
});
|
|
31
|
+
});
|