Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
alicewriteswrongs committed Jul 5, 2018
1 parent 0c7c468 commit 952041a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
9 changes: 5 additions & 4 deletions static/js/components/ExpandedPostDisplay_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,10 +361,11 @@ describe("ExpandedPostDisplay", () => {
assert.equal(wrapper.props().url, postPermalink(post))
})

it.only('should pass down hideSocialButtons to SharePopup if private channel', () => {
it("should pass down hideSocialButtons to SharePopup if private channel", () => {
channel.channel_type = "private"
const popup = renderPostDisplay({showPostShareMenu: true }).find(SharePopup)
const popup = renderPostDisplay({ postShareMenuOpen: true }).find(
SharePopup
)
assert.isTrue(popup.props().hideSocialButtons)

});
})
})
7 changes: 5 additions & 2 deletions static/js/lib/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import R from "ramda"
import qs from "query-string"

import type { Post } from '../flow/discussionTypes'
import type { Post } from "../flow/discussionTypes"

export const channelURL = (channelName: string) => `/channel/${channelName}`

Expand Down Expand Up @@ -31,7 +31,10 @@ export const commentPermalink = R.curry(
)

export const postPermalink = (post: Post): string =>
new URL(postDetailURL(post.channel_name, post.id), window.location.origin).toString()
new URL(
postDetailURL(post.channel_name, post.id),
window.location.origin
).toString()

// pull the channel name out of location.pathname
// see here for why this hackish approach was necessary:
Expand Down

0 comments on commit 952041a

Please sign in to comment.