DEV: Import MessageBus from message-bus-client instead of globals (#9902)

This commit is contained in:
Robin Ward
2020-05-27 15:56:46 -04:00
committed by GitHub
parent a788427b46
commit d3bd482142
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();
});