discourse/plugins/chat/test/javascripts/acceptance/chat-channel-slug-test.js
Roman Rizzi 0a5f548635
DEV: Move discourse-chat to the core repo. (#18776)
As part of this move, we are also renaming `discourse-chat` to `chat`.
2022-11-02 10:41:30 -03:00

25 lines
836 B
JavaScript

import { acceptance } from "discourse/tests/helpers/qunit-helpers";
import { currentURL, visit } from "@ember/test-helpers";
import { test } from "qunit";
import { chatChannels } from "discourse/plugins/chat/chat-fixtures";
acceptance("Discourse Chat - chat channel slug", function (needs) {
needs.user({ has_chat_enabled: true, can_chat: true });
needs.settings({ chat_enabled: true });
needs.pretender((server, helper) => {
server.get("/chat/chat_channels.json", () => helper.response(chatChannels));
server.get("/chat/:id/messages.json", () =>
helper.response({ chat_messages: [], meta: {} })
);
});
test("Replacing title param", async function (assert) {
await visit("/chat");
await visit("/chat/channel/11/-");
assert.equal(currentURL(), "/chat/channel/11/another-category");
});
});