From 692f5fdafb8b81901c029a86e7cc60a1474a3771 Mon Sep 17 00:00:00 2001 From: Sage Ross Date: Sat, 15 Jan 2022 18:06:12 -0800 Subject: [PATCH] Fix style violations, per automated code review --- spec/javascripts/app/models/post/interacations_spec.js | 10 +++++----- spec/javascripts/app/router_spec.js | 4 ++-- spec/javascripts/app/views/comment_view_spec.js | 8 ++++---- spec/javascripts/app/views/publisher_view_spec.js | 2 +- .../single-post-view/single_post_interactions_spec.js | 2 +- spec/javascripts/app/views/stream_post_spec.js | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/spec/javascripts/app/models/post/interacations_spec.js b/spec/javascripts/app/models/post/interacations_spec.js index 5e318b4e3..3ca66c9f9 100644 --- a/spec/javascripts/app/models/post/interacations_spec.js +++ b/spec/javascripts/app/models/post/interacations_spec.js @@ -122,11 +122,11 @@ describe("app.models.Post.Interactions", function(){ }); it("adds the reshare to the default, activity and aspects stream", function() { - app.stream = new app.models.Stream(_, { basePath: "/aspects/all" }); + app.stream = new app.models.Stream(_, {basePath: "/aspects/all"}); spyOn(app.stream, "addNow"); var self = this; - + ["/stream", "/activity", "/aspects"].forEach(function(path) { app.stream.basePath = function() { return path; }; self.interactions.reshare(); @@ -135,11 +135,11 @@ describe("app.models.Post.Interactions", function(){ expect(app.stream.addNow).toHaveBeenCalledWith({id: 1}); }); - new app.models.Stream(_, { basePath: "/aspects/all" }); + app.stream = new app.models.Stream(_, {basePath: "/aspects/all"}); }); it("doesn't add the reshare to any other stream", function() { - app.stream = new app.models.Stream(_, { basePath: "/aspects/all" }); + app.stream = new app.models.Stream(_, {basePath: "/aspects/all"}); spyOn(app.stream, "addNow"); var self = this; @@ -150,7 +150,7 @@ describe("app.models.Post.Interactions", function(){ expect(app.stream.addNow).not.toHaveBeenCalled(); }); - new app.models.Stream(_, { basePath: "/aspects/all" }); + app.stream = new app.models.Stream(_, {basePath: "/aspects/all"}); }); it("sets the participation flag for the post", function() { diff --git a/spec/javascripts/app/router_spec.js b/spec/javascripts/app/router_spec.js index 8dc768ccd..ac8df62e6 100644 --- a/spec/javascripts/app/router_spec.js +++ b/spec/javascripts/app/router_spec.js @@ -1,12 +1,12 @@ describe('app.Router', function () { - beforeEach(function () { + beforeEach(function() { delete app.page; new app.Router().stream(); }); describe('followed_tags', function() { beforeEach(function() { - loginAs({name: 'alice'}); + loginAs({name: "alice"}); factory.preloads({tagFollowings: []}); spec.loadFixture("aspects_index"); }); diff --git a/spec/javascripts/app/views/comment_view_spec.js b/spec/javascripts/app/views/comment_view_spec.js index 769e0e342..fb73ff190 100644 --- a/spec/javascripts/app/views/comment_view_spec.js +++ b/spec/javascripts/app/views/comment_view_spec.js @@ -1,11 +1,11 @@ describe("app.views.Comment", function(){ - beforeEach(function(){ + beforeEach(function() { this.post = factory.post({author : {diaspora_id : "xxx@xxx.xxx"}}); this.comment = factory.comment({parent : this.post.toJSON()}); this.view = new app.views.Comment({model : this.comment}); }); - describe("render", function(){ + describe("render", function() { it("has a delete link if the author is the current user", function(){ loginAs(this.comment.get("author")); expect(this.view.render().$('.delete').length).toBe(1); @@ -47,8 +47,8 @@ describe("app.views.Comment", function(){ }); describe("canRemove", function(){ - beforeEach(function(){ - loginAs({name:'alice'}); + beforeEach(function() { + loginAs({name: "alice"}); }); context("is truthy", function(){ diff --git a/spec/javascripts/app/views/publisher_view_spec.js b/spec/javascripts/app/views/publisher_view_spec.js index f335baeb1..a5892f77f 100644 --- a/spec/javascripts/app/views/publisher_view_spec.js +++ b/spec/javascripts/app/views/publisher_view_spec.js @@ -26,7 +26,7 @@ describe("app.views.Publisher", function() { describe("createStatusMessage", function(){ it("doesn't add the status message to the stream", function() { app.stream = new app.models.Stream(); - + spyOn(app.stream, "addNow"); this.view.createStatusMessage($.Event()); jasmine.Ajax.requests.mostRecent().respondWith({ status: 200, responseText: "{\"id\": 1}" }); diff --git a/spec/javascripts/app/views/single-post-view/single_post_interactions_spec.js b/spec/javascripts/app/views/single-post-view/single_post_interactions_spec.js index 6a24d0d24..dad2951e7 100644 --- a/spec/javascripts/app/views/single-post-view/single_post_interactions_spec.js +++ b/spec/javascripts/app/views/single-post-view/single_post_interactions_spec.js @@ -1,6 +1,6 @@ describe("app.views.SinglePostInteractions", function() { beforeEach(function() { - loginAs({name: "alice", avatar : {small : "http://avatar.com/photo.jpg"}}); + loginAs({name: "alice", avatar: {small: "http://avatar.com/photo.jpg"}}); this.post = factory.post(); this.view = new app.views.SinglePostInteractions({model: this.post}); }); diff --git a/spec/javascripts/app/views/stream_post_spec.js b/spec/javascripts/app/views/stream_post_spec.js index ab177bff6..2aa9f41fc 100644 --- a/spec/javascripts/app/views/stream_post_spec.js +++ b/spec/javascripts/app/views/stream_post_spec.js @@ -3,7 +3,7 @@ describe("app.views.StreamPost", function(){ // This puts `app.page` into the proper state. delete app.page; new app.Router().stream(); - + this.PostViewClass = app.views.StreamPost; var posts = $.parseJSON(spec.readFixture("stream_json"));