Revert "Revert "DEV: Import MessageBus from message-bus-client instead of globals""

This reverts commit b10e995d9d.
This commit is contained in:
Robin Ward
2020-05-28 08:42:36 -04:00
parent 8a3d9d7036
commit 2033c3ec9c
9 changed files with 21 additions and 12 deletions

View File

@@ -1,4 +1,6 @@
import { acceptance } from "helpers/qunit-helpers";
import MessageBus from "message-bus-client";
acceptance("Topic Discovery", {
settings: {
show_pinned_excerpt_desktop: true
@@ -85,7 +87,7 @@ QUnit.test("Live update unread state", async assert => {
);
// Mimic a messagebus message
window.MessageBus.callbacks.filterBy("channel", "/latest").map(c =>
MessageBus.callbacks.filterBy("channel", "/latest").map(c =>
c.func({
message_type: "read",
topic_id: 11995,

View File

@@ -17,7 +17,7 @@
// Stuff we need to load first
//= require vendor
//= require ember-shim
//= require discourse-shims
//= require pretty-text-bundle
//= require markdown-it-bundle
//= require application
@@ -55,8 +55,10 @@ sinon.config = {
window.inTestEnv = true;
let MessageBus = require("message-bus-client").default;
// Stop the message bus so we don't get ajax calls
window.MessageBus.stop();
MessageBus.stop();
// Trick JSHint into allow document.write
var d = document;
@@ -191,7 +193,7 @@ QUnit.testDone(function() {
window.Discourse.__container__
);
window.MessageBus.unsubscribe("*");
MessageBus.unsubscribe("*");
delete window.server;
window.Mousetrap.reset();
});