-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(sharing): Sharing of articles on social sites
- Allow users to share articles with other social media users and via email [Delivers #161966579]
- Loading branch information
1 parent
0e234d3
commit 08ad8f2
Showing
8 changed files
with
700 additions
and
376 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
div .SocialMediaShareButton{ | ||
display: inline-block; | ||
cursor: pointer; | ||
outline: none!important; | ||
margin-left: 10px!important; | ||
opacity: .9; | ||
-webkit-transition: opacity .3s ease-in-out; | ||
-moz-transition: opacity .3s ease-in-out; | ||
-ms-transition: opacity .3s ease-in-out; | ||
-o-transition: opacity .3s ease-in-out; | ||
transition: opacity .3s ease-in-out; | ||
} | ||
|
||
div .SocialMediaShareButton:hover{ | ||
opacity: 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -250,4 +250,4 @@ a.red{ | |
width: auto!important; | ||
height: 100%; | ||
width: 100%!important; | ||
} | ||
} |
126 changes: 126 additions & 0 deletions
126
src/components/__tests__/ViewSingleArticleComponent.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
import React from 'react'; | ||
import Enzyme, {shallow} from 'enzyme'; | ||
import Adapter from 'enzyme-adapter-react-16'; | ||
import configureStore from '../../store/storeConfiguration'; | ||
|
||
import ViewSingleArticleComponent from '../Article/ViewSingleArticleComponent'; | ||
|
||
Enzyme.configure({ adapter: new Adapter() }); | ||
|
||
|
||
const article = { | ||
message: 'Article found.', | ||
article: { | ||
id: 12, | ||
title: 'A must read article that could be about anything, really.', | ||
description: 'Description of my life in the music band of wannabe', | ||
body: 'Sometimes in life things come somelife someday and sometimes they never seem to', | ||
author: { | ||
username: 'silaskenny', | ||
email: 'silaskenn@gmail.com', | ||
created_at: '2019-01-24T10:01:20.335672Z', | ||
bio: '', | ||
country: '', | ||
avatar: 'https://libertv.com/wp-content/uploads/2018/03/user-avatar-placeholder-1.png', | ||
phone: '', | ||
website: '' | ||
}, | ||
tags: [], | ||
like: { | ||
likeCount: 0 | ||
}, | ||
dislike: { | ||
dislikeCount: 0 | ||
}, | ||
rating: { | ||
average: 0, | ||
distributions: {} | ||
}, | ||
image: '', | ||
article_slug: 'a-must-read-article-that-could-be-about-anything-really', | ||
created_at: '2019-01-24T10:15:01.767746Z', | ||
updated_at: '2019-01-24T10:15:01.767804Z', | ||
favorite: [], | ||
read_time: 1 | ||
} | ||
}; | ||
|
||
const getArticle = (args) => { | ||
return {} | ||
}; | ||
const success = true; | ||
const fakeProps = { | ||
match: { | ||
params:{ | ||
slug: "Google was once here" | ||
} | ||
}, | ||
article, | ||
getArticle, | ||
success | ||
}; | ||
|
||
|
||
describe('All articles', () => { | ||
it('Article container', () => { | ||
expect(typeof configureStore).toBe("object"); | ||
const wrapper = shallow(<ViewSingleArticleComponent {...fakeProps} />); | ||
expect(wrapper.find('.share-button')).toBeDefined(); | ||
}); | ||
|
||
it('Single Article', () => { | ||
const wrapper = shallow(<ViewSingleArticleComponent {...fakeProps} />); | ||
expect(wrapper.find('.share-button')).toBeDefined(); | ||
}); | ||
it('Single Article no success', () => { | ||
const props = {...fakeProps, success:false}; | ||
const wrapper = shallow(<ViewSingleArticleComponent {...props} />); | ||
expect(wrapper.find('.share-button')).toBeDefined(); | ||
}); | ||
it('Single Article processing and no success', () => { | ||
const props = {...fakeProps, reason: '', processing: true, success: false}; | ||
const wrapper = shallow(<ViewSingleArticleComponent {...props} />); | ||
expect(wrapper.find('.share-button')).toBeDefined(); | ||
}); | ||
it('Single Article processing and no success with image', () => { | ||
const article = { | ||
message: 'Article found.', | ||
article: { | ||
id: 12, | ||
title: 'A must read article that could be about anything, really.', | ||
description: 'Description of my life in the music band of wannabe', | ||
body: 'Sometimes in life things come somelife someday and sometimes they never seem to', | ||
author: { | ||
username: 'silaskenny', | ||
email: 'silaskenn@gmail.com', | ||
created_at: '2019-01-24T10:01:20.335672Z', | ||
bio: '', | ||
country: '', | ||
avatar: 'https://libertv.com/wp-content/uploads/2018/03/user-avatar-placeholder-1.png', | ||
phone: '', | ||
website: '' | ||
}, | ||
tags: [], | ||
like: { | ||
likeCount: 0 | ||
}, | ||
dislike: { | ||
dislikeCount: 0 | ||
}, | ||
rating: { | ||
average: 0, | ||
distributions: {} | ||
}, | ||
image: 'google.png', | ||
article_slug: 'a-must-read-article-that-could-be-about-anything-really', | ||
created_at: '2019-01-24T10:15:01.767746Z', | ||
updated_at: '2019-01-24T10:15:01.767804Z', | ||
favorite: [], | ||
read_time: 1 | ||
} | ||
}; | ||
const props = {...fakeProps, article: article}; | ||
const wrapper = shallow(<ViewSingleArticleComponent {...props} />); | ||
expect(wrapper.find('.share-button')).toBeDefined(); | ||
}); | ||
}); |