fixed tests

This commit is contained in:
Ben Wheeler 2019-04-26 15:50:25 -04:00
parent 433aabc1c2
commit 9622933ac7
3 changed files with 24 additions and 23 deletions

View file

@ -67,7 +67,6 @@ const PreviewPresentation = ({
comments,
editable,
extensions,
socialOpen,
faved,
favoriteCount,
intl,
@ -91,8 +90,6 @@ const PreviewPresentation = ({
onCloseAdminPanel,
onCopyProjectLink,
onDeleteComment,
onsocialClicked,
onsocialClosed,
onFavoriteClicked,
onGreenFlag,
onLoadMore,
@ -111,6 +108,8 @@ const PreviewPresentation = ({
onSeeInside,
onSetProjectThumbnailer,
onShare,
onSocialClicked,
onSocialClosed,
onToggleComments,
onToggleStudio,
onUpdateProjectId,
@ -129,6 +128,7 @@ const PreviewPresentation = ({
showAdminPanel,
showModInfo,
singleCommentId,
socialOpen,
userOwnsProject,
visibilityInfo
}) => {
@ -367,20 +367,20 @@ const PreviewPresentation = ({
<Subactions
addToStudioOpen={addToStudioOpen}
canReport={canReport}
socialOpen={socialOpen}
isAdmin={isAdmin}
projectInfo={projectInfo}
reportOpen={reportOpen}
shareDate={shareDate}
socialOpen={socialOpen}
userOwnsProject={userOwnsProject}
onAddToStudioClicked={onAddToStudioClicked}
onAddToStudioClosed={onAddToStudioClosed}
onCopyProjectLink={onCopyProjectLink}
onsocialClicked={onsocialClicked}
onsocialClosed={onsocialClosed}
onReportClicked={onReportClicked}
onReportClose={onReportClose}
onReportSubmit={onReportSubmit}
onSocialClicked={onSocialClicked}
onSocialClosed={onSocialClosed}
onToggleStudio={onToggleStudio}
/>
</div>
@ -516,20 +516,20 @@ const PreviewPresentation = ({
addToStudioOpen={addToStudioOpen}
canAddToStudio={canAddToStudio}
canReport={canReport}
socialOpen={socialOpen}
isAdmin={isAdmin}
projectInfo={projectInfo}
reportOpen={reportOpen}
shareDate={shareDate}
socialOpen={socialOpen}
userOwnsProject={userOwnsProject}
onAddToStudioClicked={onAddToStudioClicked}
onAddToStudioClosed={onAddToStudioClosed}
onCopyProjectLink={onCopyProjectLink}
onsocialClicked={onsocialClicked}
onsocialClosed={onsocialClosed}
onReportClicked={onReportClicked}
onReportClose={onReportClose}
onReportSubmit={onReportSubmit}
onSocialClicked={onSocialClicked}
onSocialClosed={onSocialClosed}
onToggleStudio={onToggleStudio}
/>
</FlexRow>
@ -704,8 +704,6 @@ PreviewPresentation.propTypes = {
onCloseAdminPanel: PropTypes.func,
onCopyProjectLink: PropTypes.func,
onDeleteComment: PropTypes.func,
onsocialClicked: PropTypes.func,
onsocialClosed: PropTypes.func,
onFavoriteClicked: PropTypes.func,
onGreenFlag: PropTypes.func,
onLoadMore: PropTypes.func,
@ -724,6 +722,8 @@ PreviewPresentation.propTypes = {
onSeeInside: PropTypes.func,
onSetProjectThumbnailer: PropTypes.func,
onShare: PropTypes.func,
onSocialClicked: PropTypes.func,
onSocialClosed: PropTypes.func,
onToggleComments: PropTypes.func,
onToggleStudio: PropTypes.func,
onUpdateProjectId: PropTypes.func,
@ -742,6 +742,7 @@ PreviewPresentation.propTypes = {
showModInfo: PropTypes.bool,
showUsernameBlockAlert: PropTypes.bool,
singleCommentId: PropTypes.oneOfType([PropTypes.number, PropTypes.bool]),
socialOpen: PropTypes.bool,
userOwnsProject: PropTypes.bool,
visibilityInfo: PropTypes.shape({
censored: PropTypes.bool,

View file

@ -57,8 +57,8 @@ class Preview extends React.Component {
'handleClickLogo',
'handleCopyProjectLink',
'handleDeleteComment',
'handlesocialClick',
'handlesocialClose',
'handleSocialClick',
'handleSocialClose',
'handleToggleStudio',
'handleFavoriteToggle',
'handleLoadMore',
@ -587,10 +587,10 @@ class Preview extends React.Component {
// Also do not include hash or query params
copy(`${window.location.origin}${window.location.pathname}`);
}
handlesocialClick () {
handleSocialClick () {
this.setState({socialOpen: true});
}
handlesocialClose () {
handleSocialClose () {
this.setState({socialOpen: false});
}
initCounts (favorites, loves) {
@ -657,7 +657,6 @@ class Preview extends React.Component {
comments={this.props.comments}
editable={this.props.isEditable}
extensions={this.state.extensions}
socialOpen={this.state.socialOpen}
faved={this.state.clientFaved}
favoriteCount={this.state.favoriteCount}
isAdmin={this.props.isAdmin}
@ -688,6 +687,7 @@ class Preview extends React.Component {
showModInfo={this.props.isAdmin}
showUsernameBlockAlert={this.state.showUsernameBlockAlert}
singleCommentId={this.state.singleCommentId}
socialOpen={this.state.socialOpen}
userOwnsProject={this.props.userOwnsProject}
visibilityInfo={this.props.visibilityInfo}
onAddComment={this.handleAddComment}
@ -696,8 +696,6 @@ class Preview extends React.Component {
onCloseAdminPanel={this.handleCloseAdminPanel}
onCopyProjectLink={this.handleCopyProjectLink}
onDeleteComment={this.handleDeleteComment}
onsocialClicked={this.handlesocialClick}
onsocialClosed={this.handlesocialClose}
onFavoriteClicked={this.handleFavoriteToggle}
onGreenFlag={this.handleGreenFlag}
onLoadMore={this.handleLoadMore}
@ -716,6 +714,8 @@ class Preview extends React.Component {
onSeeInside={this.handleSeeInside}
onSetProjectThumbnailer={this.handleSetProjectThumbnailer}
onShare={this.handleShare}
onSocialClicked={this.handleSocialClick}
onSocialClosed={this.handleSocialClose}
onToggleComments={this.handleToggleComments}
onToggleStudio={this.handleToggleStudio}
onUpdateProjectId={this.handleUpdateProjectId}

View file

@ -58,7 +58,7 @@ const Subactions = props => (
</Button>
<Button
className="action-button social-button"
onClick={props.onsocialClicked}
onClick={props.onSocialClicked}
>
<FormattedMessage id="general.socialButton" />
</Button>
@ -68,7 +68,7 @@ const Subactions = props => (
key="social-modal"
projectId={props.projectInfo && props.projectInfo.id}
onCopyProjectLink={props.onCopyProjectLink}
onRequestClose={props.onsocialClosed}
onRequestClose={props.onSocialClosed}
/>
)}
{(props.canReport) &&
@ -99,20 +99,20 @@ Subactions.propTypes = {
addToStudioOpen: PropTypes.bool,
canAddToStudio: PropTypes.bool,
canReport: PropTypes.bool,
socialOpen: PropTypes.bool,
isAdmin: PropTypes.bool,
onAddToStudioClicked: PropTypes.func,
onAddToStudioClosed: PropTypes.func,
onCopyProjectLink: PropTypes.func,
onsocialClicked: PropTypes.func,
onsocialClosed: PropTypes.func,
onReportClicked: PropTypes.func.isRequired,
onReportClose: PropTypes.func.isRequired,
onReportSubmit: PropTypes.func.isRequired,
onSocialClicked: PropTypes.func,
onSocialClosed: PropTypes.func,
onToggleStudio: PropTypes.func,
projectInfo: projectShape,
reportOpen: PropTypes.bool,
shareDate: PropTypes.string,
socialOpen: PropTypes.bool,
userOwnsProject: PropTypes.bool
};