DEV: Silence one more test (#17375)

…and improve silencing added in #17362
This commit is contained in:
Jarek Radosz 2022-07-08 03:15:09 +02:00 committed by GitHub
parent 215926f295
commit 94c70a0909
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 2 deletions

View File

@ -389,7 +389,12 @@ acceptance("Uppy Composer Attachment - Upload Error", function (needs) {
test("should show an error message for the failed upload", async function (assert) {
// Don't log the upload error
sinon.stub(console, "error");
const stub = sinon
.stub(console, "error")
.withArgs(
sinon.match(/\[Uppy\]/),
sinon.match(/Failed to upload avatar\.png/)
);
await visit("/");
await click("#create-topic");
@ -398,6 +403,7 @@ acceptance("Uppy Composer Attachment - Upload Error", function (needs) {
const done = assert.async();
appEvents.on("composer:upload-error", async () => {
sinon.assert.calledOnce(stub);
assert.strictEqual(
query(".bootbox .modal-body").innerHTML,
"There was an error uploading the file, the gif was way too cool.",

View File

@ -16,12 +16,15 @@ acceptance("Category 404", function (needs) {
test("Navigating to a bad category link does not break the router", async function (assert) {
// Don't log the XHR error
sinon.stub(console, "error");
const stub = sinon
.stub(console, "error")
.withArgs(sinon.match({ status: 404 }));
await visit("/t/internationalization-localization/280");
await click('[data-for-test="category-404"]');
assert.strictEqual(currentURL(), "/404");
sinon.assert.calledOnce(stub);
// See that we can navigate away
await click("#site-logo");

View File

@ -5,6 +5,7 @@ import {
import { test } from "qunit";
import { PresenceChannelNotFound } from "discourse/services/presence";
import { setTestPresence } from "discourse/lib/user-presence";
import sinon from "sinon";
function usersFixture() {
return [
@ -122,6 +123,12 @@ acceptance("Presence - Subscribing", function (needs) {
"updates following messagebus message"
);
const stub = sinon
.stub(console, "log")
.withArgs(
"PresenceChannel '/test/ch1' dropped message (received 99, expecting 3), resyncing..."
);
publishToMessageBus(
"/presence/test/ch1",
{
@ -133,6 +140,7 @@ acceptance("Presence - Subscribing", function (needs) {
await channel._presenceState._resubscribePromise;
sinon.assert.calledOnce(stub);
assert.strictEqual(
channel.users.length,
3,