-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: fix deprecations and warnings in tests (#1127)
* update to modern ember-qunit setup ran `ember-qunit-codemod convert-module-for-to-setup-test` * only use ember-cli-shims on neccessary ember versions fixes deprecation warning `ember.globals-resolver` https://deprecations.emberjs.com/v3.x#toc_ember-deprecate-globals-resolver * fix passive listener violations in chrome now `[Violation] Added non-passive event listener to a scroll-blocking X event. Consider marking event handler as 'passive' to make the page more responsive.` won't get logged during tests. see emberjs/ember.js#15140
- Loading branch information
Showing
6 changed files
with
39 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,21 @@ | ||
import { getOwner } from '@ember/application'; | ||
import EmberObject from '@ember/object'; | ||
import { moduleFor, test } from 'ember-qunit'; | ||
import { module, test } from 'qunit'; | ||
import { setupTest } from 'ember-qunit'; | ||
|
||
moduleFor('ember-intl@adapter:default', 'Unit | Adapter | default', { | ||
beforeEach() { | ||
this.adapter = this.subject(); | ||
} | ||
}); | ||
module('Unit | Adapter | default', function(hooks) { | ||
setupTest(hooks); | ||
|
||
hooks.beforeEach(function() { | ||
this.adapter = this.owner.lookup('ember-intl@adapter:default'); | ||
}); | ||
|
||
test('localeFactory can instantiate custom translation models', function(assert) { | ||
const klass = EmberObject.extend({ customType: true }); | ||
test('localeFactory can instantiate custom translation models', function(assert) { | ||
const klass = EmberObject.extend({ customType: true }); | ||
|
||
this.register('model:ember-intl-translation', klass); | ||
let model = this.adapter.localeFactory('en-us'); | ||
this.owner.register('model:ember-intl-translation', klass); | ||
let model = this.adapter.localeFactory('en-us'); | ||
|
||
assert.ok(klass.detectInstance(model), 'is an instance of the registered type'); | ||
assert.ok(getOwner(model), 'has an owner assigned'); | ||
assert.ok(klass.detectInstance(model), 'is an instance of the registered type'); | ||
assert.ok(this.owner, 'has an owner assigned'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,22 @@ | ||
import { moduleFor, test } from 'ember-qunit'; | ||
import { module, test } from 'qunit'; | ||
import { setupTest } from 'ember-qunit'; | ||
|
||
moduleFor('ember-intl@model:translation', 'Unit | Model | translation', { | ||
integration: true, | ||
beforeEach() { | ||
this.model = this.subject(); | ||
} | ||
}); | ||
module('Unit | Model | translation', function(hooks) { | ||
setupTest(hooks); | ||
|
||
test('can handle deeply nested object passed into addTranslations', function(assert) { | ||
this.model.addTranslations({ foo: { bar: { baz: 'BAZ WORKZ' } } }); | ||
hooks.beforeEach(function() { | ||
this.model = this.owner.lookup('ember-intl@model:translation'); | ||
}); | ||
|
||
assert.equal(this.model.getValue('foo.bar.baz'), 'BAZ WORKZ'); | ||
}); | ||
test('can handle deeply nested object passed into addTranslations', function(assert) { | ||
this.model.addTranslations({ foo: { bar: { baz: 'BAZ WORKZ' } } }); | ||
|
||
assert.equal(this.model.getValue('foo.bar.baz'), 'BAZ WORKZ'); | ||
}); | ||
|
||
test('can handle flat object shape passed into addTranslations', function(assert) { | ||
this.model.addTranslations({ baz: 'BAZZZ' }); | ||
test('can handle flat object shape passed into addTranslations', function(assert) { | ||
this.model.addTranslations({ baz: 'BAZZZ' }); | ||
|
||
assert.equal(this.model.getValue('baz'), 'BAZZZ'); | ||
assert.equal(this.model.getValue('baz'), 'BAZZZ'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5706,17 +5706,6 @@ [email protected]: | |
broccoli-sass-source-maps "^4.0.0" | ||
ember-cli-version-checker "^2.1.0" | ||
|
||
ember-cli-shims@^1.2.0: | ||
version "1.2.0" | ||
resolved "https://registry.yarnpkg.com/ember-cli-shims/-/ember-cli-shims-1.2.0.tgz#0f53aff0aab80b5f29da3a9731bac56169dd941f" | ||
integrity sha1-D1Ov8Kq4C18p2jqXMbrFYWndlB8= | ||
dependencies: | ||
broccoli-file-creator "^1.1.1" | ||
broccoli-merge-trees "^2.0.0" | ||
ember-cli-version-checker "^2.0.0" | ||
ember-rfc176-data "^0.3.1" | ||
silent-error "^1.0.1" | ||
|
||
ember-cli-string-helpers@^4.0.5: | ||
version "4.0.6" | ||
resolved "https://registry.yarnpkg.com/ember-cli-string-helpers/-/ember-cli-string-helpers-4.0.6.tgz#2f38538bfb6b8226624077cfe3ce335b8269c05c" | ||
|
@@ -6142,7 +6131,7 @@ ember-responsive@^3.0.5: | |
dependencies: | ||
ember-cli-babel "^6.6.0" | ||
|
||
ember-rfc176-data@^0.3.1, ember-rfc176-data@^0.3.12: | ||
ember-rfc176-data@^0.3.12: | ||
version "0.3.12" | ||
resolved "https://registry.yarnpkg.com/ember-rfc176-data/-/ember-rfc176-data-0.3.12.tgz#90d82878e69e2ac9a5438e8ce14d12c6031c5bd2" | ||
integrity sha512-g9HeZj/gU5bfIIrGXkP7MhS2b3Vu5DfNUrYr14hy99TgIvtZETO+96QF4WOEUXGjIJdfTRjerVnQlqngPQSv1g== | ||
|