mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 02:48:28 +08:00
DEV: Modernize chat getOwner usage (#23671)
See 8958b4f76af85ddc89c8a3b6434dcfbd4274d569 for motivation
This commit is contained in:
@ -1,7 +1,10 @@
|
||||
import { module, test } from "qunit";
|
||||
import { getOwner } from "discourse-common/lib/get-owner";
|
||||
import { getOwner } from "@ember/application";
|
||||
import { setupTest } from "ember-qunit";
|
||||
|
||||
module("Discourse Chat | Unit | chat-emoji-reaction-store", function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
hooks.beforeEach(function () {
|
||||
this.siteSettings = getOwner(this).lookup("service:site-settings");
|
||||
this.chatEmojiReactionStore = getOwner(this).lookup(
|
||||
|
@ -1,10 +1,13 @@
|
||||
import { module, test } from "qunit";
|
||||
import { getOwner } from "discourse-common/lib/get-owner";
|
||||
import { getOwner } from "@ember/application";
|
||||
import { ORIGINS } from "discourse/plugins/chat/discourse/services/chat-channel-info-route-origin-manager";
|
||||
import { setupTest } from "ember-qunit";
|
||||
|
||||
module(
|
||||
"Discourse Chat | Unit | Service | chat-channel-info-route-origin-manager",
|
||||
function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
hooks.beforeEach(function () {
|
||||
this.manager = getOwner(this).lookup(
|
||||
"service:chat-channel-info-route-origin-manager"
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { module, test } from "qunit";
|
||||
import { setupTest } from "ember-qunit";
|
||||
import { getOwner } from "discourse-common/lib/get-owner";
|
||||
import { getOwner } from "@ember/application";
|
||||
import fabricators from "discourse/plugins/chat/discourse/lib/fabricators";
|
||||
|
||||
module(
|
||||
|
@ -1,7 +1,10 @@
|
||||
import { module, test } from "qunit";
|
||||
import { getOwner } from "discourse-common/lib/get-owner";
|
||||
import { getOwner } from "@ember/application";
|
||||
import { setupTest } from "ember-qunit";
|
||||
|
||||
module("Discourse Chat | Unit | Service | chat-drawer-size", function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
hooks.beforeEach(function () {
|
||||
this.subject = getOwner(this).lookup("service:chat-drawer-size");
|
||||
});
|
||||
|
@ -1,7 +1,8 @@
|
||||
import { module, test } from "qunit";
|
||||
import { getOwner } from "discourse-common/lib/get-owner";
|
||||
import { getOwner } from "@ember/application";
|
||||
import pretender from "discourse/tests/helpers/create-pretender";
|
||||
import { settled } from "@ember/test-helpers";
|
||||
import { setupTest } from "ember-qunit";
|
||||
|
||||
function emojisReponse() {
|
||||
return { favorites: [{ name: "sad" }] };
|
||||
@ -10,6 +11,8 @@ function emojisReponse() {
|
||||
module(
|
||||
"Discourse Chat | Unit | Service | chat-emoji-picker-manager",
|
||||
function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
hooks.beforeEach(function () {
|
||||
pretender.get("/chat/emojis.json", () => {
|
||||
return [200, {}, emojisReponse()];
|
||||
|
@ -2,7 +2,7 @@ import { module, test } from "qunit";
|
||||
import { setupTest } from "ember-qunit";
|
||||
import Site from "discourse/models/site";
|
||||
import sinon from "sinon";
|
||||
import { getOwner } from "discourse-common/lib/get-owner";
|
||||
import { getOwner } from "@ember/application";
|
||||
import {
|
||||
addChatDrawerStateCallback,
|
||||
resetChatDrawerStateCallbacks,
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { setupTest } from "ember-qunit";
|
||||
import { module, test } from "qunit";
|
||||
import { getOwner } from "discourse-common/lib/get-owner";
|
||||
import { getOwner } from "@ember/application";
|
||||
import { withPluginApi } from "discourse/lib/plugin-api";
|
||||
import User from "discourse/models/user";
|
||||
import ChatMessageInteractor, {
|
||||
|
Reference in New Issue
Block a user