mirror of
https://github.com/discourse/discourse.git
synced 2025-06-06 00:24:39 +08:00
DEV: Modernize chat's component tests (#19577)
1. `test()` and `render()` instead of `componentTest()` 2. Angle brackets 3. `strictEqual()`/`true()`/`false()` assertions This removes all remaining uses of `componentTest` from core
This commit is contained in:
@ -15,7 +15,7 @@ module("Discourse Chat | Component | user-card-chat-button", function (hooks) {
|
||||
|
||||
await render(hbs`<UserCardChatButton/>`);
|
||||
|
||||
assert.ok(exists(".user-card-chat-btn"), "it shows the chat button");
|
||||
assert.true(exists(".user-card-chat-btn"), "it shows the chat button");
|
||||
});
|
||||
|
||||
test("when current user can’t send direct messages", async function (assert) {
|
||||
@ -25,7 +25,7 @@ module("Discourse Chat | Component | user-card-chat-button", function (hooks) {
|
||||
|
||||
await render(hbs`<UserCardChatButton/>`);
|
||||
|
||||
assert.notOk(
|
||||
assert.false(
|
||||
exists(".user-card-chat-btn"),
|
||||
"it doesn’t show the chat button"
|
||||
);
|
||||
|
Reference in New Issue
Block a user