Skip to content
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

retrieve current user information and display it. #118

Merged
merged 11 commits into from
Dec 31, 2020

Conversation

blankdots
Copy link
Contributor

@blankdots blankdots commented Dec 22, 2020

Description

we create a userSlice that makes use of the usersAPI to store the user information in the state

Related issues

Fixes #11

Type of change

  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Changes Made

  1. created userslice to call users API endpoint for current user and display the name
  2. add logout button
  3. fix 403 unit test for Error: Actions must be plain objects. Use custom middleware for async actions. by adding thunk
  4. unit test for store to retrieve to correct user
  5. fix integration test to match develop branch of backend
  6. upload video and screenshots artifacts on cypress failure

Testing

  • Unit Tests
  • Integration Tests

Mentions

needs the develop branch of backend
made the integration tests with cypress follow the develop branch, not sure the right choice any opinions ?

@blankdots blankdots self-assigned this Dec 22, 2020
we create a userSlice that makes use of the usersAPI to store the user information in the state
dispatch call needs to be mocked not to be considered a plain action and for that we used thunk
reset user state once the button has been clicked.
Update nav test js
we mock the user using the mockauth API and verify the name is set accordingly to fixtures
this will force to keep master branch in sync
@blankdots blankdots marked this pull request as ready for review December 28, 2020 12:18
@blankdots blankdots requested review from hannyle, saulipurhonen and lilachic and removed request for hannyle December 28, 2020 12:18
Copy link
Contributor

@hannyle hannyle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Login and get user info works fine for me
  • Logout also works

@blankdots blankdots added the enhancement New feature or request label Dec 29, 2020
@blankdots
Copy link
Contributor Author

will merge as is and if anything comes up will create a hotfix

@blankdots blankdots merged commit 2a8e36f into develop Dec 31, 2020
@blankdots blankdots deleted the feature/user-login branch December 31, 2020 07:39
@blankdots blankdots mentioned this pull request Dec 31, 2020
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants