UX: Move links from gutter to below posts

This commit is contained in:
Robin Ward
2016-05-16 14:31:52 -04:00
parent e9ba6e4e99
commit 4a7567b485
9 changed files with 137 additions and 182 deletions

View File

@@ -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);