Upgrade QUnit to latest version

This commit is contained in:
Robin Ward
2017-06-14 13:57:58 -04:00
parent 8ae445766f
commit cc525b1a8d
145 changed files with 7569 additions and 6763 deletions
@@ -4,7 +4,7 @@ moduleForWidget('actions-summary');
widgetTest('listing actions', {
template: '{{mount-widget widget="actions-summary" args=args}}',
setup() {
beforeEach() {
this.set('args', {
actionsSummary: [
{id: 1, action: 'off_topic', description: 'very off topic'},
@@ -24,7 +24,7 @@ widgetTest('listing actions', {
widgetTest('undo', {
template: '{{mount-widget widget="actions-summary" args=args undoPostAction=undoPostAction}}',
setup() {
beforeEach() {
this.set('args', {
actionsSummary: [
{action: 'off_topic', description: 'very off topic', canUndo: true},
@@ -45,7 +45,7 @@ widgetTest('undo', {
widgetTest('deferFlags', {
template: '{{mount-widget widget="actions-summary" args=args deferPostActionFlags="deferPostActionFlags"}}',
setup() {
beforeEach() {
this.set('args', {
actionsSummary: [
{action: 'off_topic', description: 'very off topic', canDeferFlags: true, count: 1},
@@ -66,7 +66,7 @@ widgetTest('deferFlags', {
widgetTest('post deleted', {
template: '{{mount-widget widget="actions-summary" args=args}}',
setup() {
beforeEach() {
this.set('args', {
deleted_at: "2016-01-01",
deletedByUsername: 'eviltrout',
@@ -5,7 +5,7 @@ moduleForWidget('hamburger-menu');
widgetTest('prioritize faq', {
template: '{{mount-widget widget="hamburger-menu"}}',
setup() {
beforeEach() {
this.siteSettings.faq_url = 'http://example.com/faq';
this.currentUser.set('read_faq', false);
},
@@ -19,7 +19,7 @@ widgetTest('prioritize faq', {
widgetTest('prioritize faq - user has read', {
template: '{{mount-widget widget="hamburger-menu"}}',
setup() {
beforeEach() {
this.siteSettings.faq_url = 'http://example.com/faq';
this.currentUser.set('read_faq', true);
},
@@ -33,7 +33,7 @@ widgetTest('prioritize faq - user has read', {
widgetTest('staff menu - not staff', {
template: '{{mount-widget widget="hamburger-menu"}}',
setup() {
beforeEach() {
this.currentUser.set('staff', false);
},
@@ -45,7 +45,7 @@ widgetTest('staff menu - not staff', {
widgetTest('staff menu', {
template: '{{mount-widget widget="hamburger-menu"}}',
setup() {
beforeEach() {
this.currentUser.setProperties({ staff: true, site_flagged_posts_count: 3 });
},
@@ -60,7 +60,7 @@ widgetTest('staff menu', {
widgetTest('staff menu - admin', {
template: '{{mount-widget widget="hamburger-menu"}}',
setup() {
beforeEach() {
this.currentUser.setProperties({ staff: true, admin: true });
},
@@ -73,7 +73,7 @@ widgetTest('staff menu - admin', {
widgetTest('queued posts', {
template: '{{mount-widget widget="hamburger-menu"}}',
setup() {
beforeEach() {
this.currentUser.setProperties({
staff: true,
show_queued_posts: true,
@@ -90,7 +90,7 @@ widgetTest('queued posts', {
widgetTest('queued posts - disabled', {
template: '{{mount-widget widget="hamburger-menu"}}',
setup() {
beforeEach() {
this.currentUser.setProperties({ staff: true, show_queued_posts: false });
},
@@ -127,7 +127,7 @@ widgetTest('general links', {
widgetTest('badges link - disabled', {
template: '{{mount-widget widget="hamburger-menu"}}',
setup() {
beforeEach() {
this.siteSettings.enable_badges = false;
},
@@ -155,7 +155,7 @@ widgetTest('user directory link', {
widgetTest('user directory link - disabled', {
template: '{{mount-widget widget="hamburger-menu"}}',
setup() {
beforeEach() {
this.siteSettings.enable_user_directory = false;
},
+3 -3
View File
@@ -14,7 +14,7 @@ widgetTest('sign up / login buttons', {
template: '{{mount-widget widget="header" showCreateAccount="showCreateAccount" showLogin="showLogin" args=args}}',
anonymous: true,
setup() {
beforeEach() {
this.set('args', { canSignUp: true });
this.on('showCreateAccount', () => this.signupShown = true);
this.on('showLogin', () => this.loginShown = true);
@@ -40,7 +40,7 @@ widgetTest('anon when login required', {
template: '{{mount-widget widget="header" showCreateAccount="showCreateAccount" showLogin="showLogin" args=args}}',
anonymous: true,
setup() {
beforeEach() {
this.set('args', { canSignUp: true });
this.on('showCreateAccount', () => this.signupShown = true);
this.on('showLogin', () => this.loginShown = true);
@@ -58,7 +58,7 @@ widgetTest('anon when login required', {
widgetTest('logged in when login required', {
template: '{{mount-widget widget="header" showCreateAccount="showCreateAccount" showLogin="showLogin" args=args}}',
setup() {
beforeEach() {
this.set('args', { canSignUp: true });
this.on('showCreateAccount', () => this.signupShown = true);
this.on('showLogin', () => this.loginShown = true);
@@ -9,7 +9,7 @@ const title = "Cool Forum";
widgetTest('basics', {
template: '{{mount-widget widget="home-logo" args=args}}',
setup() {
beforeEach() {
this.siteSettings.logo_url = bigLogo;
this.siteSettings.logo_small_url = smallLogo;
this.siteSettings.title = title;
@@ -27,7 +27,7 @@ widgetTest('basics', {
widgetTest('basics - minimized', {
template: '{{mount-widget widget="home-logo" args=args}}',
setup() {
beforeEach() {
this.siteSettings.logo_url = bigLogo;
this.siteSettings.logo_small_url= smallLogo;
this.siteSettings.title = title;
@@ -43,7 +43,7 @@ widgetTest('basics - minimized', {
widgetTest('no logo', {
template: '{{mount-widget widget="home-logo" args=args}}',
setup() {
beforeEach() {
this.siteSettings.logo_url = '';
this.siteSettings.logo_small_url = '';
this.siteSettings.title = title;
@@ -58,7 +58,7 @@ widgetTest('no logo', {
widgetTest('no logo - minimized', {
template: '{{mount-widget widget="home-logo" args=args}}',
setup() {
beforeEach() {
this.siteSettings.logo_url = '';
this.siteSettings.logo_small_url = '';
this.siteSettings.title = title;
@@ -72,7 +72,7 @@ widgetTest('no logo - minimized', {
widgetTest('mobile logo', {
template: '{{mount-widget widget="home-logo" args=args}}',
setup() {
beforeEach() {
this.siteSettings.mobile_logo_url = mobileLogo;
this.siteSettings.logo_small_url= smallLogo;
this.site.mobileView = true;
@@ -86,7 +86,7 @@ widgetTest('mobile logo', {
widgetTest('mobile without logo', {
template: '{{mount-widget widget="home-logo" args=args}}',
setup() {
beforeEach() {
this.siteSettings.logo_url = bigLogo;
this.site.mobileView = true;
},
@@ -4,7 +4,7 @@ moduleForWidget('post-links');
widgetTest("duplicate links", {
template: '{{mount-widget widget="post-links" args=args}}',
setup() {
beforeEach() {
this.set('args', {
id: 2,
links: [
@@ -20,7 +20,7 @@ widgetTest("duplicate links", {
widgetTest("collapsed links", {
template: '{{mount-widget widget="post-links" args=args}}',
setup() {
beforeEach() {
this.set('args', {
id: 1,
links: [
@@ -7,7 +7,7 @@ moduleForWidget('post-stream');
function postStreamTest(name, attrs) {
widgetTest(name, {
template: `{{mount-widget widget="post-stream" args=(hash posts=posts)}}`,
setup() {
beforeEach() {
this.set('posts', attrs.posts.call(this));
},
test: attrs.test
+55 -55
View File
@@ -4,7 +4,7 @@ moduleForWidget('post');
widgetTest('basic elements', {
template: '{{mount-widget widget="post" args=args}}',
setup() {
beforeEach() {
this.set('args', { shareUrl: '/example', post_number: 1 });
},
test(assert) {
@@ -18,7 +18,7 @@ widgetTest('basic elements', {
widgetTest('wiki', {
template: '{{mount-widget widget="post" args=args showHistory="showHistory"}}',
setup() {
beforeEach() {
this.set('args', { wiki: true, version: 2, canViewEditHistory: true });
this.on('showHistory', () => this.historyShown = true);
},
@@ -32,7 +32,7 @@ widgetTest('wiki', {
widgetTest('wiki without revision', {
template: '{{mount-widget widget="post" args=args editPost="editPost"}}',
setup() {
beforeEach() {
this.set('args', { wiki: true, version: 1, canViewEditHistory: true });
this.on('editPost', () => this.editPostCalled = true);
},
@@ -46,7 +46,7 @@ widgetTest('wiki without revision', {
widgetTest('via-email', {
template: '{{mount-widget widget="post" args=args showRawEmail="showRawEmail"}}',
setup() {
beforeEach() {
this.set('args', { via_email: true, canViewRawEmail: true });
this.on('showRawEmail', () => this.rawEmailShown = true);
},
@@ -60,7 +60,7 @@ widgetTest('via-email', {
widgetTest('via-email without permission', {
template: '{{mount-widget widget="post" args=args showRawEmail="showRawEmail"}}',
setup() {
beforeEach() {
this.set('args', { via_email: true, canViewRawEmail: false });
this.on('showRawEmail', () => this.rawEmailShown = true);
},
@@ -74,7 +74,7 @@ widgetTest('via-email without permission', {
widgetTest('history', {
template: '{{mount-widget widget="post" args=args showHistory="showHistory"}}',
setup() {
beforeEach() {
this.set('args', { version: 3, canViewEditHistory: true });
this.on('showHistory', () => this.historyShown = true);
},
@@ -88,7 +88,7 @@ widgetTest('history', {
widgetTest('history without view permission', {
template: '{{mount-widget widget="post" args=args showHistory="showHistory"}}',
setup() {
beforeEach() {
this.set('args', { version: 3, canViewEditHistory: false });
this.on('showHistory', () => this.historyShown = true);
},
@@ -102,7 +102,7 @@ widgetTest('history without view permission', {
widgetTest('whisper', {
template: '{{mount-widget widget="post" args=args}}',
setup() {
beforeEach() {
this.set('args', { isWhisper: true });
},
test(assert) {
@@ -113,7 +113,7 @@ widgetTest('whisper', {
widgetTest('like count button', {
template: '{{mount-widget widget="post" model=post args=args}}',
setup(store) {
beforeEach(store) {
const topic = store.createRecord('topic', {id: 123});
const post = store.createRecord('post', {
id: 1,
@@ -147,7 +147,7 @@ widgetTest('like count button', {
widgetTest(`like count with no likes`, {
template: '{{mount-widget widget="post" model=post args=args}}',
setup() {
beforeEach() {
this.set('args', { likeCount: 0 });
},
test(assert) {
@@ -157,7 +157,7 @@ widgetTest(`like count with no likes`, {
widgetTest('share button', {
template: '{{mount-widget widget="post" args=args}}',
setup() {
beforeEach() {
this.set('args', { shareUrl: 'http://share-me.example.com' });
},
test(assert) {
@@ -167,7 +167,7 @@ widgetTest('share button', {
widgetTest('liking', {
template: '{{mount-widget widget="post-menu" args=args toggleLike="toggleLike"}}',
setup() {
beforeEach() {
const args = { showLike: true, canToggleLike: true };
this.set('args', args);
this.on('toggleLike', () => {
@@ -198,7 +198,7 @@ widgetTest('liking', {
widgetTest('anon liking', {
template: '{{mount-widget widget="post-menu" args=args showLogin="showLogin"}}',
anonymous: true,
setup() {
beforeEach() {
const args = { showLike: true };
this.set('args', args);
this.on("showLogin", () => this.loginShown = true);
@@ -217,7 +217,7 @@ widgetTest('anon liking', {
widgetTest('edit button', {
template: '{{mount-widget widget="post" args=args editPost="editPost"}}',
setup() {
beforeEach() {
this.set('args', { canEdit: true });
this.on('editPost', () => this.editPostCalled = true);
},
@@ -231,7 +231,7 @@ widgetTest('edit button', {
widgetTest(`edit button - can't edit`, {
template: '{{mount-widget widget="post" args=args editPost="editPost"}}',
setup() {
beforeEach() {
this.set('args', { canEdit: false });
},
test(assert) {
@@ -241,7 +241,7 @@ widgetTest(`edit button - can't edit`, {
widgetTest('recover button', {
template: '{{mount-widget widget="post" args=args deletePost="deletePost"}}',
setup() {
beforeEach() {
this.set('args', { canDelete: true });
this.on('deletePost', () => this.deletePostCalled = true);
},
@@ -255,7 +255,7 @@ widgetTest('recover button', {
widgetTest('delete topic button', {
template: '{{mount-widget widget="post" args=args deletePost="deletePost"}}',
setup() {
beforeEach() {
this.set('args', { canDeleteTopic: true });
this.on('deletePost', () => this.deletePostCalled = true);
},
@@ -269,7 +269,7 @@ widgetTest('delete topic button', {
widgetTest(`delete topic button - can't delete`, {
template: '{{mount-widget widget="post" args=args deletePost="deletePost"}}',
setup() {
beforeEach() {
this.set('args', { canDeleteTopic: false });
},
test(assert) {
@@ -279,7 +279,7 @@ widgetTest(`delete topic button - can't delete`, {
widgetTest('recover topic button', {
template: '{{mount-widget widget="post" args=args recoverPost="recoverPost"}}',
setup() {
beforeEach() {
this.set('args', { canRecoverTopic: true });
this.on('recoverPost', () => this.recovered = true);
},
@@ -291,7 +291,7 @@ widgetTest('recover topic button', {
widgetTest(`recover topic button - can't recover`, {
template: '{{mount-widget widget="post" args=args deletePost="deletePost"}}',
setup() {
beforeEach() {
this.set('args', { canRecoverTopic: false });
},
test(assert) {
@@ -301,7 +301,7 @@ widgetTest(`recover topic button - can't recover`, {
widgetTest('delete post button', {
template: '{{mount-widget widget="post" args=args deletePost="deletePost"}}',
setup() {
beforeEach() {
this.set('args', { canDelete: true });
this.on('deletePost', () => this.deletePostCalled = true);
},
@@ -315,7 +315,7 @@ widgetTest('delete post button', {
widgetTest(`delete post button - can't delete`, {
template: '{{mount-widget widget="post" args=args}}',
setup() {
beforeEach() {
this.set('args', { canDelete: false });
},
test(assert) {
@@ -325,7 +325,7 @@ widgetTest(`delete post button - can't delete`, {
widgetTest('recover post button', {
template: '{{mount-widget widget="post" args=args recoverPost="recoverPost"}}',
setup() {
beforeEach() {
this.set('args', { canRecover: true });
this.on('recoverPost', () => this.recovered = true);
},
@@ -337,7 +337,7 @@ widgetTest('recover post button', {
widgetTest(`recover post button - can't recover`, {
template: '{{mount-widget widget="post" args=args deletePost="deletePost"}}',
setup() {
beforeEach() {
this.set('args', { canRecover: false });
},
test(assert) {
@@ -347,7 +347,7 @@ widgetTest(`recover post button - can't recover`, {
widgetTest(`flagging`, {
template: '{{mount-widget widget="post" args=args showFlags="showFlags"}}',
setup() {
beforeEach() {
this.set('args', { canFlag: true });
this.on('showFlags', () => this.flagsShown = true);
},
@@ -363,7 +363,7 @@ widgetTest(`flagging`, {
widgetTest(`flagging: can't flag`, {
template: '{{mount-widget widget="post" args=args}}',
setup() {
beforeEach() {
this.set('args', { canFlag: false });
},
test(assert) {
@@ -373,7 +373,7 @@ widgetTest(`flagging: can't flag`, {
widgetTest(`read indicator`, {
template: '{{mount-widget widget="post" args=args}}',
setup() {
beforeEach() {
this.set('args', { read: true });
},
test(assert) {
@@ -383,7 +383,7 @@ widgetTest(`read indicator`, {
widgetTest(`unread indicator`, {
template: '{{mount-widget widget="post" args=args}}',
setup() {
beforeEach() {
this.set('args', { read: false });
},
test(assert) {
@@ -393,7 +393,7 @@ widgetTest(`unread indicator`, {
widgetTest("reply directly above (supressed)", {
template: '{{mount-widget widget="post" args=args}}',
setup() {
beforeEach() {
this.set('args', {
replyToUsername: 'eviltrout',
replyToAvatarTemplate: '/images/avatar.png',
@@ -408,7 +408,7 @@ widgetTest("reply directly above (supressed)", {
widgetTest("reply a few posts above (supressed)", {
template: '{{mount-widget widget="post" args=args}}',
setup() {
beforeEach() {
this.set('args', {
replyToUsername: 'eviltrout',
replyToAvatarTemplate: '/images/avatar.png',
@@ -423,7 +423,7 @@ widgetTest("reply a few posts above (supressed)", {
widgetTest("reply directly above", {
template: '{{mount-widget widget="post" args=args}}',
setup() {
beforeEach() {
this.set('args', {
replyToUsername: 'eviltrout',
replyToAvatarTemplate: '/images/avatar.png',
@@ -443,7 +443,7 @@ widgetTest("reply directly above", {
widgetTest("cooked content hidden", {
template: '{{mount-widget widget="post" args=args expandHidden="expandHidden"}}',
setup() {
beforeEach() {
this.set('args', { cooked_hidden: true });
this.on('expandHidden', () => this.unhidden = true);
},
@@ -457,7 +457,7 @@ widgetTest("cooked content hidden", {
widgetTest("expand first post", {
template: '{{mount-widget widget="post" model=post args=args}}',
setup(store) {
beforeEach(store) {
this.set('args', { expandablePost: true });
this.set('post', store.createRecord('post', { id: 1234 }));
},
@@ -471,7 +471,7 @@ widgetTest("expand first post", {
widgetTest("can't bookmark", {
template: '{{mount-widget widget="post" args=args}}',
setup() {
beforeEach() {
this.set('args', { canBookmark: false });
},
test(assert) {
@@ -482,7 +482,7 @@ widgetTest("can't bookmark", {
widgetTest("bookmark", {
template: '{{mount-widget widget="post" args=args toggleBookmark="toggleBookmark"}}',
setup() {
beforeEach() {
const args = { canBookmark: true };
this.set('args', args);
@@ -501,7 +501,7 @@ widgetTest("bookmark", {
widgetTest("can't show admin menu when you can't manage", {
template: '{{mount-widget widget="post" args=args}}',
setup() {
beforeEach() {
this.set('args', { canManage: false });
},
test(assert) {
@@ -511,7 +511,7 @@ widgetTest("can't show admin menu when you can't manage", {
widgetTest("show admin menu", {
template: '{{mount-widget widget="post" args=args}}',
setup() {
beforeEach() {
this.set('args', { canManage: true });
},
test(assert) {
@@ -529,7 +529,7 @@ widgetTest("show admin menu", {
widgetTest("toggle moderator post", {
template: '{{mount-widget widget="post" args=args togglePostType="togglePostType"}}',
setup() {
beforeEach() {
this.set('args', { canManage: true });
this.on('togglePostType', () => this.toggled = true);
},
@@ -544,7 +544,7 @@ widgetTest("toggle moderator post", {
});
widgetTest("toggle moderator post", {
template: '{{mount-widget widget="post" args=args togglePostType="togglePostType"}}',
setup() {
beforeEach() {
this.set('args', { canManage: true });
this.on('togglePostType', () => this.toggled = true);
},
@@ -560,7 +560,7 @@ widgetTest("toggle moderator post", {
widgetTest("rebake post", {
template: '{{mount-widget widget="post" args=args rebakePost="rebakePost"}}',
setup() {
beforeEach() {
this.set('args', { canManage: true });
this.on('rebakePost', () => this.baked = true);
},
@@ -576,7 +576,7 @@ widgetTest("rebake post", {
widgetTest("unhide post", {
template: '{{mount-widget widget="post" args=args unhidePost="unhidePost"}}',
setup() {
beforeEach() {
this.set('args', { canManage: true, hidden: true });
this.on('unhidePost', () => this.unhidden = true);
},
@@ -592,7 +592,7 @@ widgetTest("unhide post", {
widgetTest("change owner", {
template: '{{mount-widget widget="post" args=args changePostOwner="changePostOwner"}}',
setup() {
beforeEach() {
this.currentUser.admin = true;
this.set('args', { canManage: true });
this.on('changePostOwner', () => this.owned = true);
@@ -609,7 +609,7 @@ widgetTest("change owner", {
widgetTest("reply", {
template: '{{mount-widget widget="post" args=args replyToPost="replyToPost"}}',
setup() {
beforeEach() {
this.set('args', { canCreatePost: true });
this.on('replyToPost', () => this.replied = true);
},
@@ -623,7 +623,7 @@ widgetTest("reply", {
widgetTest("reply - without permissions", {
template: '{{mount-widget widget="post" args=args}}',
setup() {
beforeEach() {
this.set('args', { canCreatePost: false });
},
test(assert) {
@@ -633,7 +633,7 @@ widgetTest("reply - without permissions", {
widgetTest("replies - no replies", {
template: '{{mount-widget widget="post" args=args}}',
setup() {
beforeEach() {
this.set('args', {replyCount: 0});
},
test(assert) {
@@ -643,7 +643,7 @@ widgetTest("replies - no replies", {
widgetTest("replies - multiple replies", {
template: '{{mount-widget widget="post" args=args}}',
setup() {
beforeEach() {
this.siteSettings.suppress_reply_directly_below = true;
this.set('args', {replyCount: 2, replyDirectlyBelow: true});
},
@@ -654,7 +654,7 @@ widgetTest("replies - multiple replies", {
widgetTest("replies - one below, suppressed", {
template: '{{mount-widget widget="post" args=args}}',
setup() {
beforeEach() {
this.siteSettings.suppress_reply_directly_below = true;
this.set('args', {replyCount: 1, replyDirectlyBelow: true});
},
@@ -665,7 +665,7 @@ widgetTest("replies - one below, suppressed", {
widgetTest("replies - one below, not suppressed", {
template: '{{mount-widget widget="post" args=args}}',
setup() {
beforeEach() {
this.siteSettings.suppress_reply_directly_below = false;
this.set('args', {id: 6654, replyCount: 1, replyDirectlyBelow: true});
},
@@ -680,7 +680,7 @@ widgetTest("replies - one below, not suppressed", {
widgetTest("topic map not shown", {
template: '{{mount-widget widget="post" args=args}}',
setup() {
beforeEach() {
this.set('args', { showTopicMap: false });
},
test(assert) {
@@ -690,7 +690,7 @@ widgetTest("topic map not shown", {
widgetTest("topic map - few posts", {
template: '{{mount-widget widget="post" args=args}}',
setup() {
beforeEach() {
this.set('args', {
showTopicMap: true,
topicPostsCount: 2,
@@ -712,7 +712,7 @@ widgetTest("topic map - few posts", {
widgetTest("topic map - participants", {
template: '{{mount-widget widget="post" args=args}}',
setup() {
beforeEach() {
this.set('args', {
showTopicMap: true,
topicPostsCount: 10,
@@ -739,7 +739,7 @@ widgetTest("topic map - participants", {
widgetTest("topic map - links", {
template: '{{mount-widget widget="post" args=args}}',
setup() {
beforeEach() {
this.set('args', {
showTopicMap: true,
topicLinks: [
@@ -774,7 +774,7 @@ widgetTest("topic map - links", {
widgetTest("topic map - no summary", {
template: '{{mount-widget widget="post" args=args}}',
setup() {
beforeEach() {
this.set('args', { showTopicMap: true });
},
test(assert) {
@@ -784,7 +784,7 @@ widgetTest("topic map - no summary", {
widgetTest("topic map - has summary", {
template: '{{mount-widget widget="post" args=args toggleSummary="toggleSummary"}}',
setup() {
beforeEach() {
this.set('args', { showTopicMap: true, hasTopicSummary: true });
this.on('toggleSummary', () => this.summaryToggled = true);
},
@@ -798,7 +798,7 @@ widgetTest("topic map - has summary", {
widgetTest("pm map", {
template: '{{mount-widget widget="post" args=args}}',
setup() {
beforeEach() {
this.set('args', {
showTopicMap: true,
showPMMap: true,
@@ -4,7 +4,7 @@ moduleForWidget('poster-name');
widgetTest('basic rendering', {
template: '{{mount-widget widget="poster-name" args=args}}',
setup() {
beforeEach() {
this.set('args', {
username: 'eviltrout',
usernameUrl: '/u/eviltrout',
@@ -23,7 +23,7 @@ widgetTest('basic rendering', {
widgetTest('extra classes and glyphs', {
template: '{{mount-widget widget="poster-name" args=args}}',
setup() {
beforeEach() {
this.set('args', {
username: 'eviltrout',
usernameUrl: '/u/eviltrout',
@@ -46,7 +46,7 @@ widgetTest('extra classes and glyphs', {
widgetTest('disable display name on posts', {
template: '{{mount-widget widget="poster-name" args=args}}',
setup() {
beforeEach() {
this.siteSettings.display_name_on_posts = false;
this.set('args', { username: 'eviltrout', name: 'Robin Ward' });
},
@@ -57,7 +57,7 @@ widgetTest('disable display name on posts', {
widgetTest("doesn't render a name if it's similar to the username", {
template: '{{mount-widget widget="poster-name" args=args}}',
setup() {
beforeEach() {
this.siteSettings.prioritize_username_in_ux = true;
this.siteSettings.display_name_on_posts = true;
this.set('args', { username: 'eviltrout', name: 'evil-trout' });
@@ -5,7 +5,7 @@ moduleForWidget('topic-participant');
widgetTest('one post', {
template: '{{mount-widget widget="topic-participant" args=args}}',
setup() {
beforeEach() {
this.set('args', {
username: 'test',
avatar_template: '/images/avatar.png',
@@ -23,7 +23,7 @@ widgetTest('one post', {
widgetTest('many posts, a primary group with flair', {
template: '{{mount-widget widget="topic-participant" args=args}}',
setup() {
beforeEach() {
this.set('args', {
username: 'test',
avatar_template: '/images/avatar.png',
@@ -17,7 +17,7 @@ widgetTest('basics', {
widgetTest('log out', {
template: '{{mount-widget widget="user-menu" logout="logout"}}',
setup() {
beforeEach() {
this.on('logout', () => this.loggedOut = true);
},
@@ -33,7 +33,7 @@ widgetTest('log out', {
widgetTest('private messages - disabled', {
template: '{{mount-widget widget="user-menu"}}',
setup() {
beforeEach() {
this.siteSettings.enable_private_messages = false;
},
@@ -44,7 +44,7 @@ widgetTest('private messages - disabled', {
widgetTest('private messages - enabled', {
template: '{{mount-widget widget="user-menu"}}',
setup() {
beforeEach() {
this.siteSettings.enable_private_messages = true;
},
@@ -56,7 +56,7 @@ widgetTest('private messages - enabled', {
widgetTest('anonymous', {
template: '{{mount-widget widget="user-menu" toggleAnonymous="toggleAnonymous"}}',
setup() {
beforeEach() {
this.currentUser.setProperties({ is_anonymous: false, trust_level: 3 });
this.siteSettings.allow_anonymous_posting = true;
this.siteSettings.anonymous_posting_min_trust_level = 3;
@@ -76,7 +76,7 @@ widgetTest('anonymous', {
widgetTest('anonymous - disabled', {
template: '{{mount-widget widget="user-menu"}}',
setup() {
beforeEach() {
this.siteSettings.allow_anonymous_posting = false;
},
@@ -88,7 +88,7 @@ widgetTest('anonymous - disabled', {
widgetTest('anonymous - switch back', {
template: '{{mount-widget widget="user-menu" toggleAnonymous="toggleAnonymous"}}',
setup() {
beforeEach() {
this.currentUser.setProperties({ is_anonymous: true });
this.siteSettings.allow_anonymous_posting = true;
@@ -103,4 +103,3 @@ widgetTest('anonymous - switch back', {
});
}
});
+10 -10
View File
@@ -7,7 +7,7 @@ moduleForWidget('base');
widgetTest('widget attributes are passed in via args', {
template: `{{mount-widget widget="hello-test" args=args}}`,
setup() {
beforeEach() {
createWidget('hello-test', {
tagName: 'div.test',
@@ -27,7 +27,7 @@ widgetTest('widget attributes are passed in via args', {
widgetTest('buildClasses', {
template: `{{mount-widget widget="classname-test" args=args}}`,
setup() {
beforeEach() {
createWidget('classname-test', {
tagName: 'div.test',
@@ -47,7 +47,7 @@ widgetTest('buildClasses', {
widgetTest('buildAttributes', {
template: `{{mount-widget widget="attributes-test" args=args}}`,
setup() {
beforeEach() {
createWidget('attributes-test', {
tagName: 'div.test',
@@ -68,7 +68,7 @@ widgetTest('buildAttributes', {
widgetTest('buildId', {
template: `{{mount-widget widget="id-test" args=args}}`,
setup() {
beforeEach() {
createWidget('id-test', {
buildId(attrs) {
return `test-${attrs.id}`;
@@ -86,7 +86,7 @@ widgetTest('buildId', {
widgetTest('widget state', {
template: `{{mount-widget widget="state-test"}}`,
setup() {
beforeEach() {
createWidget('state-test', {
tagName: 'button.test',
buildKey: () => `button-test`,
@@ -119,7 +119,7 @@ widgetTest('widget state', {
widgetTest('widget update with promise', {
template: `{{mount-widget widget="promise-test"}}`,
setup() {
beforeEach() {
createWidget('promise-test', {
tagName: 'button.test',
buildKey: () => 'promise-test',
@@ -152,7 +152,7 @@ widgetTest('widget update with promise', {
widgetTest('widget attaching', {
template: `{{mount-widget widget="attach-test"}}`,
setup() {
beforeEach() {
createWidget('test-embedded', { tagName: 'div.embedded' });
createWidget('attach-test', {
@@ -172,7 +172,7 @@ widgetTest('widget attaching', {
widgetTest('widget decorating', {
template: `{{mount-widget widget="decorate-test"}}`,
setup() {
beforeEach() {
createWidget('decorate-test', {
tagName: 'div.decorate',
html() {
@@ -201,7 +201,7 @@ widgetTest('widget decorating', {
widgetTest('widget settings', {
template: `{{mount-widget widget="settings-test"}}`,
setup() {
beforeEach() {
createWidget('settings-test', {
tagName: 'div.settings',
@@ -223,7 +223,7 @@ widgetTest('widget settings', {
widgetTest('override settings', {
template: `{{mount-widget widget="ov-settings-test"}}`,
setup() {
beforeEach() {
createWidget('ov-settings-test', {
tagName: 'div.settings',