2015-04-06 14:14:00 -04:00
|
|
|
import { acceptance } from "helpers/qunit-helpers";
|
2018-11-19 04:01:22 -05:00
|
|
|
import DiscourseURL from "discourse/lib/url";
|
2018-05-09 11:27:59 -04:00
|
|
|
|
2015-04-06 14:14:00 -04:00
|
|
|
acceptance("User Card");
|
2014-10-20 12:11:36 -04:00
|
|
|
|
2018-07-19 10:40:12 -04:00
|
|
|
QUnit.test("user card", async assert => {
|
2019-03-25 08:37:17 -04:00
|
|
|
await visit("/t/internationalization-localization/280");
|
2018-06-15 11:03:24 -04:00
|
|
|
assert.ok(invisible("#user-card"), "user card is invisible by default");
|
2014-10-20 12:11:36 -04:00
|
|
|
|
2018-07-19 10:40:12 -04:00
|
|
|
await click("a[data-user-card=eviltrout]:first");
|
|
|
|
assert.ok(visible("#user-card"), "card should appear");
|
2018-11-19 04:01:22 -05:00
|
|
|
|
|
|
|
sandbox.stub(DiscourseURL, "routeTo");
|
2019-03-25 08:37:17 -04:00
|
|
|
await click(".card-content a.user-profile-link");
|
|
|
|
assert.ok(
|
|
|
|
DiscourseURL.routeTo.calledWith("/u/eviltrout"),
|
|
|
|
"it should navigate to the user profile"
|
|
|
|
);
|
2018-04-17 18:52:23 -04:00
|
|
|
});
|