mirror of
https://github.com/discourse/discourse.git
synced 2025-09-07 12:02:53 +08:00
DEV: introduces prettier for es6 files
This commit is contained in:
parent
c7ee70941e
commit
03a7d532cf
1162 changed files with 60667 additions and 29659 deletions
|
@ -1,80 +1,81 @@
|
|||
import { moduleForWidget, widgetTest } from 'helpers/widget-test';
|
||||
import { moduleForWidget, widgetTest } from "helpers/widget-test";
|
||||
|
||||
moduleForWidget('user-menu');
|
||||
moduleForWidget("user-menu");
|
||||
|
||||
widgetTest('basics', {
|
||||
widgetTest("basics", {
|
||||
template: '{{mount-widget widget="user-menu"}}',
|
||||
|
||||
test(assert) {
|
||||
assert.ok(this.$('.user-menu').length);
|
||||
assert.ok(this.$('.user-activity-link').length);
|
||||
assert.ok(this.$('.user-bookmarks-link').length);
|
||||
assert.ok(this.$('.user-preferences-link').length);
|
||||
assert.ok(this.$('.notifications').length);
|
||||
assert.ok(this.$('.dismiss-link').length);
|
||||
assert.ok(this.$(".user-menu").length);
|
||||
assert.ok(this.$(".user-activity-link").length);
|
||||
assert.ok(this.$(".user-bookmarks-link").length);
|
||||
assert.ok(this.$(".user-preferences-link").length);
|
||||
assert.ok(this.$(".notifications").length);
|
||||
assert.ok(this.$(".dismiss-link").length);
|
||||
}
|
||||
});
|
||||
|
||||
widgetTest('log out', {
|
||||
widgetTest("log out", {
|
||||
template: '{{mount-widget widget="user-menu" logout="logout"}}',
|
||||
|
||||
beforeEach() {
|
||||
this.on('logout', () => this.loggedOut = true);
|
||||
this.on("logout", () => (this.loggedOut = true));
|
||||
},
|
||||
|
||||
test(assert) {
|
||||
assert.ok(this.$('.logout').length);
|
||||
assert.ok(this.$(".logout").length);
|
||||
|
||||
click('.logout');
|
||||
click(".logout");
|
||||
andThen(() => {
|
||||
assert.ok(this.loggedOut);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
widgetTest('private messages - disabled', {
|
||||
widgetTest("private messages - disabled", {
|
||||
template: '{{mount-widget widget="user-menu"}}',
|
||||
beforeEach() {
|
||||
this.siteSettings.enable_personal_messages = false;
|
||||
},
|
||||
|
||||
test(assert) {
|
||||
assert.ok(!this.$('.user-pms-link').length);
|
||||
assert.ok(!this.$(".user-pms-link").length);
|
||||
}
|
||||
});
|
||||
|
||||
widgetTest('private messages - enabled', {
|
||||
widgetTest("private messages - enabled", {
|
||||
template: '{{mount-widget widget="user-menu"}}',
|
||||
beforeEach() {
|
||||
this.siteSettings.enable_personal_messages = true;
|
||||
},
|
||||
|
||||
test(assert) {
|
||||
assert.ok(this.$('.user-pms-link').length);
|
||||
assert.ok(this.$(".user-pms-link").length);
|
||||
}
|
||||
});
|
||||
|
||||
widgetTest('anonymous', {
|
||||
template: '{{mount-widget widget="user-menu" toggleAnonymous="toggleAnonymous"}}',
|
||||
widgetTest("anonymous", {
|
||||
template:
|
||||
'{{mount-widget widget="user-menu" toggleAnonymous="toggleAnonymous"}}',
|
||||
|
||||
beforeEach() {
|
||||
this.currentUser.setProperties({ is_anonymous: false, trust_level: 3 });
|
||||
this.siteSettings.allow_anonymous_posting = true;
|
||||
this.siteSettings.anonymous_posting_min_trust_level = 3;
|
||||
|
||||
this.on('toggleAnonymous', () => this.anonymous = true);
|
||||
this.on("toggleAnonymous", () => (this.anonymous = true));
|
||||
},
|
||||
|
||||
test(assert) {
|
||||
assert.ok(this.$('.enable-anonymous').length);
|
||||
click('.enable-anonymous');
|
||||
assert.ok(this.$(".enable-anonymous").length);
|
||||
click(".enable-anonymous");
|
||||
andThen(() => {
|
||||
assert.ok(this.anonymous);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
widgetTest('anonymous - disabled', {
|
||||
widgetTest("anonymous - disabled", {
|
||||
template: '{{mount-widget widget="user-menu"}}',
|
||||
|
||||
beforeEach() {
|
||||
|
@ -82,23 +83,24 @@ widgetTest('anonymous - disabled', {
|
|||
},
|
||||
|
||||
test(assert) {
|
||||
assert.ok(!this.$('.enable-anonymous').length);
|
||||
assert.ok(!this.$(".enable-anonymous").length);
|
||||
}
|
||||
});
|
||||
|
||||
widgetTest('anonymous - switch back', {
|
||||
template: '{{mount-widget widget="user-menu" toggleAnonymous="toggleAnonymous"}}',
|
||||
widgetTest("anonymous - switch back", {
|
||||
template:
|
||||
'{{mount-widget widget="user-menu" toggleAnonymous="toggleAnonymous"}}',
|
||||
|
||||
beforeEach() {
|
||||
this.currentUser.setProperties({ is_anonymous: true });
|
||||
this.siteSettings.allow_anonymous_posting = true;
|
||||
|
||||
this.on('toggleAnonymous', () => this.anonymous = true);
|
||||
this.on("toggleAnonymous", () => (this.anonymous = true));
|
||||
},
|
||||
|
||||
test(assert) {
|
||||
assert.ok(this.$('.disable-anonymous').length);
|
||||
click('.disable-anonymous');
|
||||
assert.ok(this.$(".disable-anonymous").length);
|
||||
click(".disable-anonymous");
|
||||
andThen(() => {
|
||||
assert.ok(this.anonymous);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue