mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 23:49:34 +08:00
[WIP] FEATURE: merge share and invite actions together (#7021)
This commit also: - removes [+ New Topic] behaviour from share, this feature has been duplicated in composer actions, months ago - introduces our new experimental spacing standard for css: eg: `s(2)` - introduces a new panel UI for modals
This commit is contained in:
@ -22,29 +22,6 @@ acceptance("Topic", {
|
||||
}
|
||||
});
|
||||
|
||||
QUnit.test("Share Popup", async assert => {
|
||||
await visit("/t/internationalization-localization/280");
|
||||
assert.ok(!exists("#share-link.visible"), "it is not visible");
|
||||
|
||||
await click("button[data-share-url]");
|
||||
assert.ok(exists("#share-link.visible"), "it shows the popup");
|
||||
|
||||
await click("#share-link .close-share");
|
||||
assert.ok(!exists("#share-link.visible"), "it closes the popup");
|
||||
|
||||
// TODO tgxworld This fails on Travis but we need to push the security fix out
|
||||
// first.
|
||||
// click('#topic-footer-buttons .btn.create');
|
||||
// fillIn('.d-editor-input', '<h2><div data-share-url="something">Click</button><h2>');
|
||||
//
|
||||
// click('#reply-control .btn.create');
|
||||
// click('h2 div[data-share-url]');
|
||||
//
|
||||
// andThen(() => {
|
||||
// ok(!exists('#share-link.visible'), 'it does not show the popup');
|
||||
// });
|
||||
});
|
||||
|
||||
QUnit.test("Showing and hiding the edit controls", async assert => {
|
||||
await visit("/t/internationalization-localization/280");
|
||||
|
||||
@ -98,69 +75,6 @@ QUnit.test("Marking a topic as wiki", async assert => {
|
||||
assert.ok(find("a.wiki").length === 1, "it shows the wiki icon");
|
||||
});
|
||||
|
||||
QUnit.test("Reply as new topic", async assert => {
|
||||
await visit("/t/internationalization-localization/280");
|
||||
await click("button.share:eq(0)");
|
||||
await click(".reply-as-new-topic a");
|
||||
|
||||
assert.ok(exists(".d-editor-input"), "the composer input is visible");
|
||||
|
||||
assert.equal(
|
||||
find(".d-editor-input")
|
||||
.val()
|
||||
.trim(),
|
||||
`Continuing the discussion from [Internationalization / localization](${
|
||||
window.location.origin
|
||||
}/t/internationalization-localization/280):`,
|
||||
"it fills composer with the ring string"
|
||||
);
|
||||
assert.equal(
|
||||
selectKit(".category-chooser")
|
||||
.header()
|
||||
.value(),
|
||||
"2",
|
||||
"it fills category selector with the right category"
|
||||
);
|
||||
});
|
||||
|
||||
QUnit.test("Reply as new message", async assert => {
|
||||
await visit("/t/pm-for-testing/12");
|
||||
await click("button.share:eq(0)");
|
||||
await click(".reply-as-new-topic a");
|
||||
|
||||
assert.ok(exists(".d-editor-input"), "the composer input is visible");
|
||||
|
||||
assert.equal(
|
||||
find(".d-editor-input")
|
||||
.val()
|
||||
.trim(),
|
||||
`Continuing the discussion from [PM for testing](${
|
||||
window.location.origin
|
||||
}/t/pm-for-testing/12):`,
|
||||
"it fills composer with the ring string"
|
||||
);
|
||||
|
||||
const targets = find(".item span", ".composer-fields");
|
||||
|
||||
assert.equal(
|
||||
$(targets[0]).text(),
|
||||
"someguy",
|
||||
"it fills up the composer with the right user to start the PM to"
|
||||
);
|
||||
|
||||
assert.equal(
|
||||
$(targets[1]).text(),
|
||||
"test",
|
||||
"it fills up the composer with the right user to start the PM to"
|
||||
);
|
||||
|
||||
assert.equal(
|
||||
$(targets[2]).text(),
|
||||
"Group",
|
||||
"it fills up the composer with the right group to start the PM to"
|
||||
);
|
||||
});
|
||||
|
||||
QUnit.test("Visit topic routes", async assert => {
|
||||
await visit("/t/12");
|
||||
|
||||
|
Reference in New Issue
Block a user