DEV: Clean up mobileView/desktopView uses (#26229)

Inspired by a piece of "do not do x if it's not a mobile view" code 🙃
This commit is contained in:
Jarek Radosz
2024-03-18 23:29:42 +01:00
committed by GitHub
parent 9c3ddd46f0
commit 11099434b5
39 changed files with 85 additions and 83 deletions

View File

@ -3,7 +3,7 @@ import hbs from "htmlbars-inline-precompile";
import { module, test } from "qunit";
import { setupRenderingTest } from "discourse/tests/helpers/component-test";
import pretender from "discourse/tests/helpers/create-pretender";
import { exists, query } from "discourse/tests/helpers/qunit-helpers";
import { query } from "discourse/tests/helpers/qunit-helpers";
import I18n from "discourse-i18n";
import fabricators from "discourse/plugins/chat/discourse/lib/fabricators";
@ -47,11 +47,11 @@ module("Discourse Chat | Component | chat-channel-leave-btn", function (hooks) {
});
test("is not visible on mobile", async function (assert) {
this.site.mobileView = true;
this.site.desktopView = false;
this.channel = fabricators.channel();
await render(hbs`<ChatChannelLeaveBtn @channel={{this.channel}} />`);
assert.false(exists(".chat-channel-leave-btn"));
assert.dom(".chat-channel-leave-btn").doesNotExist();
});
});