mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
UX: Move links from gutter to below posts
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import { moduleForWidget, widgetTest } from 'helpers/widget-test';
|
||||
|
||||
moduleForWidget('post-gutter');
|
||||
moduleForWidget('post-links');
|
||||
|
||||
widgetTest("duplicate links", {
|
||||
template: '{{mount-widget widget="post-gutter" args=args}}',
|
||||
template: '{{mount-widget widget="post-links" args=args}}',
|
||||
setup() {
|
||||
this.set('args', {
|
||||
id: 2,
|
||||
@@ -14,12 +14,15 @@ widgetTest("duplicate links", {
|
||||
});
|
||||
},
|
||||
test(assert) {
|
||||
assert.equal(this.$('.post-links a.track-link').length, 1, 'it hides the dupe link');
|
||||
click('.expand-links');
|
||||
andThen(() => {
|
||||
assert.equal(this.$('.post-links a.track-link').length, 1, 'it hides the dupe link');
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
widgetTest("collapsed links", {
|
||||
template: '{{mount-widget widget="post-gutter" args=args}}',
|
||||
template: '{{mount-widget widget="post-links" args=args}}',
|
||||
setup() {
|
||||
this.set('args', {
|
||||
id: 1,
|
||||
@@ -35,8 +38,8 @@ widgetTest("collapsed links", {
|
||||
});
|
||||
},
|
||||
test(assert) {
|
||||
assert.equal(this.$('.post-links a.track-link').length, 5, 'collapses by default');
|
||||
click('a.toggle-more');
|
||||
assert.ok(this.$('.expand-links').length, 'collapsed by default');
|
||||
click('a.expand-links');
|
||||
andThen(() => {
|
||||
assert.equal(this.$('.post-links a.track-link').length, 7);
|
||||
});
|
||||
@@ -44,7 +47,7 @@ widgetTest("collapsed links", {
|
||||
});
|
||||
|
||||
widgetTest("reply as new topic", {
|
||||
template: '{{mount-widget widget="post-gutter" args=args newTopicAction="newTopicAction"}}',
|
||||
template: '{{mount-widget widget="post-links" args=args newTopicAction="newTopicAction"}}',
|
||||
setup() {
|
||||
this.set('args', { canReplyAsNewTopic: true });
|
||||
this.on('newTopicAction', () => this.newTopicTriggered = true);
|
||||
Reference in New Issue
Block a user