mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
Fix failing tests.
This commit is contained in:
parent
bd46bc62ff
commit
7e076d63ba
2 changed files with 21 additions and 2 deletions
|
@ -1,7 +1,6 @@
|
||||||
import { createWidget } from 'discourse/widgets/widget';
|
import { createWidget } from 'discourse/widgets/widget';
|
||||||
import { avatarAtts } from 'discourse/widgets/actions-summary';
|
import { avatarAtts } from 'discourse/widgets/actions-summary';
|
||||||
import { h } from 'virtual-dom';
|
import { h } from 'virtual-dom';
|
||||||
import User from 'discourse/models/user';
|
|
||||||
|
|
||||||
const LIKE_ACTION = 2;
|
const LIKE_ACTION = 2;
|
||||||
|
|
||||||
|
@ -308,7 +307,7 @@ export default createWidget('post-menu', {
|
||||||
},
|
},
|
||||||
|
|
||||||
like() {
|
like() {
|
||||||
if (!User.current()) {
|
if (!this.currentUser) {
|
||||||
return this.sendWidgetAction('showLogin');
|
return this.sendWidgetAction('showLogin');
|
||||||
}
|
}
|
||||||
const attrs = this.attrs;
|
const attrs = this.attrs;
|
||||||
|
|
|
@ -181,6 +181,26 @@ widgetTest('liking', {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
widgetTest('anon liking', {
|
||||||
|
template: '{{mount-widget widget="post-menu" args=args showLogin="showLogin"}}',
|
||||||
|
anonymous: true,
|
||||||
|
setup() {
|
||||||
|
const args = { showLike: true };
|
||||||
|
this.set('args', args);
|
||||||
|
this.on("showLogin", () => this.loginShown = true);
|
||||||
|
},
|
||||||
|
test(assert) {
|
||||||
|
assert.ok(!!this.$('.actions button.like').length);
|
||||||
|
assert.ok(this.$('.actions button.like-count').length === 0);
|
||||||
|
|
||||||
|
click('.actions button.like');
|
||||||
|
andThen(() => {
|
||||||
|
assert.ok(this.loginShown);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
widgetTest('edit button', {
|
widgetTest('edit button', {
|
||||||
template: '{{mount-widget widget="post" args=args editPost="editPost"}}',
|
template: '{{mount-widget widget="post" args=args editPost="editPost"}}',
|
||||||
setup() {
|
setup() {
|
||||||
|
|
Loading…
Reference in a new issue