mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 01:56:58 +08:00
DEV: Convert more equal
assertions (#29554)
…to either qunit-dom or `strictEqual`
This commit is contained in:
@ -3,14 +3,14 @@ import slugifyChannel from "discourse/plugins/chat/discourse/lib/slugify-channel
|
||||
|
||||
module("Discourse Chat | Unit | slugify-channel", function () {
|
||||
test("defaults for title", function (assert) {
|
||||
assert.equal(slugifyChannel({ title: "Foo bar" }), "foo-bar");
|
||||
assert.strictEqual(slugifyChannel({ title: "Foo bar" }), "foo-bar");
|
||||
});
|
||||
|
||||
test("a very long name for the title", function (assert) {
|
||||
const string =
|
||||
"xAq8l5ca2CtEToeMLe2pEr2VUGQBx3HPlxbkDExKrJHp4f7jCVw9id1EQv1N1lYMRdAIiZNnn94Kr0uU0iiEeVO4XkBVmpW8Mknmd";
|
||||
|
||||
assert.equal(
|
||||
assert.strictEqual(
|
||||
slugifyChannel({ title: string }),
|
||||
string.toLowerCase().slice(0, -1)
|
||||
);
|
||||
@ -19,18 +19,18 @@ module("Discourse Chat | Unit | slugify-channel", function () {
|
||||
test("a cyrillic name for the title", function (assert) {
|
||||
const string = "Русская литература и фольклор";
|
||||
|
||||
assert.equal(
|
||||
assert.strictEqual(
|
||||
slugifyChannel({ title: string }),
|
||||
"русская-литература-и-фольклор"
|
||||
);
|
||||
});
|
||||
|
||||
test("channel has escapedTitle", function (assert) {
|
||||
assert.equal(slugifyChannel({ escapedTitle: "Foo bar" }), "foo-bar");
|
||||
assert.strictEqual(slugifyChannel({ escapedTitle: "Foo bar" }), "foo-bar");
|
||||
});
|
||||
|
||||
test("channel has slug and title", function (assert) {
|
||||
assert.equal(
|
||||
assert.strictEqual(
|
||||
slugifyChannel({ title: "Foo bar", slug: "some-other-thing" }),
|
||||
"some-other-thing",
|
||||
"slug takes priority"
|
||||
|
Reference in New Issue
Block a user