Skip to content

Commit

Permalink
Support Ember 3.0 - 3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaurav0 committed Jun 9, 2018
1 parent 76bed88 commit 34492fe
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
8 changes: 4 additions & 4 deletions app/services/dependency-resolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import compareVersions from 'compare-versions';

const { computed, deprecate, inject, RSVP, testing } = Ember;

const EMBER_VERSIONS = ['2.18.2', '2.17.2', '2.16.2', '2.15.3', '2.14.1', '2.13.0', '2.12.0'];
const EMBER_DATA_VERSIONS = ['2.18.2', '2.17.1', '2.16.4', '2.15.3', '2.14.10', '2.13.2', '2.12.2'];
const EMBER_VERSIONS = ['3.2.0', '3.1.2', '3.0.0', '2.18.2', '2.17.2', '2.16.2', '2.15.3', '2.14.1', '2.13.0', '2.12.0'];
const EMBER_DATA_VERSIONS = ['3.1.1', '3.0.2', '2.18.2', '2.17.1', '2.16.4', '2.15.3', '2.14.10', '2.13.2', '2.12.2'];

const VERSION_REGEX = /^\d+.\d+.\d+(-beta\.\d+)?$/;

Expand Down Expand Up @@ -165,7 +165,7 @@ export default Ember.Service.extend({

if (name === 'ember-data') {
const msg = 'It is recommended you use ember-data as an addon';
deprecate(msg, false, {
deprecate(msg, testing, {
id: 'ember-twiddle.deprecate-ember-data-as-dependency',
until: '0.16.0',
});
Expand All @@ -176,7 +176,7 @@ export default Ember.Service.extend({

if (compareVersions(version, '2.12.0') === -1) {
const msg = 'Versions of Ember prior to 2.12.0 are no longer supported in Ember Twiddle';
deprecate(msg, false, {
deprecate(msg, testing, {
id: 'ember-twiddle.deprecate-ember-versions-before-2-12',
until: '0.16.0',
});
Expand Down
8 changes: 4 additions & 4 deletions blueprints/twiddle.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js",
"ember": "2.18.2",
"ember-template-compiler": "2.18.2",
"ember-testing": "2.18.2"
"ember": "3.2.0",
"ember-template-compiler": "3.2.0",
"ember-testing": "3.2.0"
},
"addons": {
"ember-data": "2.18.2"
"ember-data": "3.1.1"
}
}
6 changes: 6 additions & 0 deletions tests/acceptance/gist-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ test('unsaved indicator', function(assert) {
click(firstColumnTextarea);
fillIn(firstColumnTextarea, "\"some text\";");
triggerEvent(firstColumnTextarea, "blur");
triggerEvent(firstColumnTextarea, "focusout");

andThen(function() {
return timeout(10);
Expand Down Expand Up @@ -362,6 +363,11 @@ test('editing a file updates gist', function(assert) {
click(firstColumnTextarea);
fillIn(firstColumnTextarea, '<div class="index">some text</div>');
triggerEvent(firstColumnTextarea, "blur");
triggerEvent(firstColumnTextarea, "focusout");

andThen(function() {
return timeout(10);
});

andThen(function() {
assert.equal(find(firstColumnTextarea).val(), '<div class="index">some text</div>');
Expand Down
10 changes: 6 additions & 4 deletions tests/integration/components/build-messages-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ test('it shows the number of build messages', function(assert) {
this.set('buildErrors', []);
this.set('isBuilding', false);
this.set('notify', {
info() {}
info() {},
error() {}
});

this.render(hbs`{{build-messages buildErrors=buildErrors isBuilding=isBuilding notify=notify}}`);
Expand All @@ -31,12 +32,13 @@ test('it shows the number of build messages', function(assert) {
assert.equal(this.$('span').text().replace(/\s+/g, " ").trim(), 'Output ( 2 build errors )', 'shows number of build errors');
});

test('it calls notify.info() when clicking on build errors', function(assert) {
test('it calls notify.errpr() when clicking on build errors', function(assert) {
assert.expect(1);

let notifyObject = Ember.Object.create({
called: false,
info() {
info() {},
error() {
this.set('called', true);
}
});
Expand All @@ -50,5 +52,5 @@ test('it calls notify.info() when clicking on build errors', function(assert) {

this.$('span a').click();

assert.ok(notifyObject.get('called'), "notify.info() was called");
assert.ok(notifyObject.get('called'), "notify.error() was called");
});

0 comments on commit 34492fe

Please sign in to comment.