DEV: Import EmberObject rather than global variable (#8256)

* DEV: Import ember/object rather than Ember.Object globally

* fixed broken object proxy import

* prettier on js

* added @ember/object/proxy to loader

* added unstaged file

* Fixed objet proxy reference is loader

* Linting!
This commit is contained in:
Mark VanLandingham
2019-10-29 14:23:50 -05:00
committed by GitHub
parent 74dc37c07c
commit c7475ee03b
81 changed files with 200 additions and 120 deletions
@@ -1,3 +1,4 @@
import EmberObject from "@ember/object";
moduleFor("controller:preferences/account");
QUnit.test("updating of associated accounts", function(assert) {
@@ -5,11 +6,11 @@ QUnit.test("updating of associated accounts", function(assert) {
siteSettings: {
enable_google_oauth2_logins: true
},
model: Ember.Object.create({
model: EmberObject.create({
second_factor_enabled: true,
is_anonymous: true
}),
site: Ember.Object.create({
site: EmberObject.create({
isMobileDevice: false
})
});
@@ -1,3 +1,4 @@
import EmberObject from "@ember/object";
import { mapRoutes } from "discourse/mapping-router";
import createStore from "helpers/create-store";
@@ -16,7 +17,7 @@ QUnit.test("fixIndices set unique position number", function(assert) {
categories.push(store.createRecord("category", { id: i, position: 0 }));
}
const site = Ember.Object.create({ categories: categories });
const site = EmberObject.create({ categories: categories });
const reorderCategoriesController = this.subject({ site });
reorderCategoriesController.fixIndices();
@@ -59,7 +60,7 @@ QUnit.test(
const categories = [child2, parent, other, child1];
const expectedOrderSlugs = ["parent", "child2", "child1", "other"];
const site = Ember.Object.create({ categories: categories });
const site = EmberObject.create({ categories: categories });
const reorderCategoriesController = this.subject({ site });
reorderCategoriesController.fixIndices();
@@ -95,7 +96,7 @@ QUnit.test(
});
const categories = [elem1, elem2, elem3];
const site = Ember.Object.create({ categories: categories });
const site = EmberObject.create({ categories: categories });
const reorderCategoriesController = this.subject({ site });
reorderCategoriesController.actions.change.call(
@@ -142,7 +143,7 @@ QUnit.test(
});
const categories = [elem1, child1, elem2, elem3];
const site = Ember.Object.create({ categories: categories });
const site = EmberObject.create({ categories: categories });
const reorderCategoriesController = this.subject({ site });
reorderCategoriesController.actions.change.call(
@@ -189,7 +190,7 @@ QUnit.test(
});
const categories = [elem1, child1, elem2, elem3];
const site = Ember.Object.create({ categories: categories });
const site = EmberObject.create({ categories: categories });
const reorderCategoriesController = this.subject({ site });
reorderCategoriesController.fixIndices();
@@ -1,3 +1,4 @@
import EmberObject from "@ember/object";
import Topic from "discourse/models/topic";
import PostStream from "discourse/models/post-stream";
import { Placeholder } from "discourse/lib/posts-with-placeholders";
@@ -191,7 +192,7 @@ QUnit.test("selectedPostsUsername", function(assert) {
});
QUnit.test("showSelectedPostsAtBottom", function(assert) {
const site = Ember.Object.create({ mobileView: false });
const site = EmberObject.create({ mobileView: false });
const model = Topic.create({ posts_count: 3 });
const controller = this.subject({ model, site });
@@ -467,7 +468,7 @@ QUnit.test("togglePostSelection", function(assert) {
// });
QUnit.test("selectBelow", function(assert) {
const site = Ember.Object.create({
const site = EmberObject.create({
post_types: { small_action: 3, whisper: 4 }
});
@@ -521,7 +522,7 @@ QUnit.test(
});
let destroyed;
const post = Ember.Object.create({
const post = EmberObject.create({
id: 2,
post_number: 2,
can_delete: true,
@@ -532,12 +533,12 @@ QUnit.test(
}
});
const postStream = Ember.Object.create({
const postStream = EmberObject.create({
stream: [2, 3, 4],
posts: [post, { id: 3 }, { id: 4 }]
});
const currentUser = Ember.Object.create({ moderator: true });
const currentUser = EmberObject.create({ moderator: true });
const model = Topic.create({ postStream });
const controller = this.subject({ model, currentUser });