mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: user and group cards on mobile (#7246)
This commit is contained in:
@@ -1,11 +1,22 @@
|
||||
import { acceptance } from "helpers/qunit-helpers";
|
||||
import DiscourseURL from "discourse/lib/url";
|
||||
|
||||
acceptance("Group Card - Mobile", { mobileView: true });
|
||||
|
||||
QUnit.test("group card", async assert => {
|
||||
await visit("/t/301/1");
|
||||
assert.ok(invisible("#group-card"), "user card is invisible by default");
|
||||
assert.ok(
|
||||
invisible("#group-card"),
|
||||
"mobile group card is invisible by default"
|
||||
);
|
||||
|
||||
await click("a.mention-group:first");
|
||||
assert.ok(visible(".group-details-container"), "group page should be shown");
|
||||
assert.ok(visible("#group-card"), "mobile group card should appear");
|
||||
|
||||
sandbox.stub(DiscourseURL, "routeTo");
|
||||
await click(".card-content a.group-page-link");
|
||||
assert.ok(
|
||||
DiscourseURL.routeTo.calledWith("/g/discourse"),
|
||||
"it should navigate to the group page"
|
||||
);
|
||||
});
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { acceptance } from "helpers/qunit-helpers";
|
||||
import DiscourseURL from "discourse/lib/url";
|
||||
|
||||
acceptance("Group Card");
|
||||
|
||||
@@ -8,4 +9,11 @@ QUnit.test("group card", async assert => {
|
||||
|
||||
await click("a.mention-group:first");
|
||||
assert.ok(visible("#group-card"), "card should appear");
|
||||
|
||||
sandbox.stub(DiscourseURL, "routeTo");
|
||||
await click(".card-content a.group-page-link");
|
||||
assert.ok(
|
||||
DiscourseURL.routeTo.calledWith("/g/discourse"),
|
||||
"it should navigate to the group page"
|
||||
);
|
||||
});
|
||||
|
||||
22
test/javascripts/acceptance/user-card-mobile-test.js.es6
Normal file
22
test/javascripts/acceptance/user-card-mobile-test.js.es6
Normal file
@@ -0,0 +1,22 @@
|
||||
import { acceptance } from "helpers/qunit-helpers";
|
||||
import DiscourseURL from "discourse/lib/url";
|
||||
|
||||
acceptance("User Card - Mobile", { mobileView: true });
|
||||
|
||||
QUnit.test("user card", async assert => {
|
||||
await visit("/t/internationalization-localization/280");
|
||||
assert.ok(
|
||||
invisible("#user-card"),
|
||||
"mobile user card is invisible by default"
|
||||
);
|
||||
|
||||
await click("a[data-user-card=eviltrout]:first");
|
||||
assert.ok(visible("#user-card"), "mobile user card should appear");
|
||||
|
||||
sandbox.stub(DiscourseURL, "routeTo");
|
||||
await click(".card-content a.user-profile-link");
|
||||
assert.ok(
|
||||
DiscourseURL.routeTo.calledWith("/u/eviltrout"),
|
||||
"it should navigate to the user profile"
|
||||
);
|
||||
});
|
||||
@@ -4,13 +4,16 @@ import DiscourseURL from "discourse/lib/url";
|
||||
acceptance("User Card");
|
||||
|
||||
QUnit.test("user card", async assert => {
|
||||
await visit("/");
|
||||
await visit("/t/internationalization-localization/280");
|
||||
assert.ok(invisible("#user-card"), "user card is invisible by default");
|
||||
|
||||
await click("a[data-user-card=eviltrout]:first");
|
||||
assert.ok(visible("#user-card"), "card should appear");
|
||||
|
||||
sandbox.stub(DiscourseURL, "routeTo");
|
||||
await click(".card-content a.mention");
|
||||
assert.ok(DiscourseURL.routeTo.calledWith("/u/eviltrout"));
|
||||
await click(".card-content a.user-profile-link");
|
||||
assert.ok(
|
||||
DiscourseURL.routeTo.calledWith("/u/eviltrout"),
|
||||
"it should navigate to the user profile"
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user