mirror of
https://github.com/discourse/discourse.git
synced 2024-12-05 04:43:43 +08:00
0a5f548635
As part of this move, we are also renaming `discourse-chat` to `chat`.
22 lines
786 B
JavaScript
22 lines
786 B
JavaScript
import { module, test } from "qunit";
|
|
import slugifyChannel from "discourse/plugins/chat/discourse/lib/slugify-channel";
|
|
|
|
module("Discourse Chat | Unit | slugify-channel", function () {
|
|
test("defaults", function (assert) {
|
|
assert.equal(slugifyChannel("Foo bar"), "foo-bar");
|
|
});
|
|
|
|
test("a very long name", function (assert) {
|
|
const string =
|
|
"xAq8l5ca2CtEToeMLe2pEr2VUGQBx3HPlxbkDExKrJHp4f7jCVw9id1EQv1N1lYMRdAIiZNnn94Kr0uU0iiEeVO4XkBVmpW8Mknmd";
|
|
|
|
assert.equal(slugifyChannel(string), string.toLowerCase().slice(0, -1));
|
|
});
|
|
|
|
test("a cyrillic name", function (assert) {
|
|
const string = "Русская литература и фольклор";
|
|
|
|
assert.equal(slugifyChannel(string), "русская-литература-и-фольклор");
|
|
});
|
|
});
|