-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#161348759 Rating an article #16
Conversation
const initalState = { | ||
}; | ||
|
||
const ratingReducer = (state = initalState, action) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
src/components/Rating/Rating.test.js
Outdated
}); | ||
}); | ||
|
||
describe('<Rating />', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
expect(ratingReducer(initalState, action)).toEqual(expectedData); | ||
}); | ||
|
||
test('test rating post data succesfully', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
expect(ratingReducer(initalState, action)).toEqual(expectedData); | ||
}); | ||
|
||
test('test rating post succesfully', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
const headers = { | ||
headers: { Authorization: token }, | ||
}; | ||
return axios.post(url, data, headers) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identical blocks of code found in 2 locations. Consider refactoring.
5356397
to
bf1aee2
Compare
src/actions/ratingActions/index.js
Outdated
payload: rate, | ||
}); | ||
|
||
export const fetchRatingThunk = () => dispatch => axios.get('https://ah-backend-thanos-staging.herokuapp.com/api/articles/7') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identical blocks of code found in 2 locations. Consider refactoring.
bf1aee2
to
968f36c
Compare
type: ACTION_TYPE.GET_RATING_SUCCESS, | ||
}]; | ||
const store = mockStore({}); | ||
store.dispatch(fetchRatingThunk()).then(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 3 locations. Consider refactoring.
payload: { message: 'ok' }, | ||
}]; | ||
const store = mockStore({}); | ||
store.dispatch(postRating()).then(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 3 locations. Consider refactoring.
// import and pass your custom axios instance to this method | ||
moxios.uninstall(); | ||
}); | ||
test('Successful get rating action', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
payload: rate, | ||
})); | ||
}); | ||
test('successfull post rating action', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
c1a233f
to
d646cd1
Compare
}; | ||
|
||
const mockStore = configureMockStore([thunk]); | ||
const LoginComponent = shallow(<Login onChange={jest.fn()} onSubmit={jest.fn()} />); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
src/components/Rating/Rating.test.js
Outdated
|
||
describe('<Rating />', () => { | ||
test('renders the component', () => { | ||
const RatingComponent = shallow( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
70058d9
to
0cfd840
Compare
0cfd840
to
fdf2ba8
Compare
fdf2ba8
to
ace3248
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR diff size of 15976 lines exceeds the maximum allowed for the inline comments feature.
6f5ecd5
to
079043a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR diff size of 15993 lines exceeds the maximum allowed for the inline comments feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing the tests and code climate issues. Looks good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks Good, The UI is well implemented
dc2a9f8
dda685a
to
9345bd1
Compare
)); | ||
}); | ||
}); | ||
test('get rate successfull', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
)); | ||
}); | ||
}); | ||
test('get rate Failed', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
bbab163
to
3383e6e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR diff size of 15078 lines exceeds the maximum allowed for the inline comments feature.
- Add 5 star rating for a single article - Add radio buttons for a user to rate an article. [#161348759]
3383e6e
to
1796c96
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR diff size of 15079 lines exceeds the maximum allowed for the inline comments feature.
Code Climate has analyzed commit 1796c96 and detected 0 issues on this pull request. View more on Code Climate. |
What does this PR do?
Description of Task to be completed?
How should this be manually tested?
What are the relevant pivotal tracker stories?
#161348759
Screenshots