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

Add test case for main store #995

Merged
merged 9 commits into from
Nov 28, 2023
Merged

Conversation

Jeezman
Copy link
Contributor

@Jeezman Jeezman commented Nov 24, 2023

Describe your changes

Add test cases for main store saveProfile and saveBounty

Issue ticket number and link

closes #972

Type of change

Test

@elraphty
Copy link
Contributor

Nice work @Jeezman, I get this error in the console when I try to run the test

    console.log
      TypeError: Cannot read properties of undefined (reading 'status')
          at MainStore.<anonymous> (/Users/raphaelosazeeyerin/Desktop/Sphinx/sphinx-tribes/frontend/app/src/store/main.ts:1385:20)
          at step (/Users/raphaelosazeeyerin/Desktop/Sphinx/sphinx-tribes/frontend/app/src/store/main.ts:50:23)
          at Object.next (/Users/raphaelosazeeyerin/Desktop/Sphinx/sphinx-tribes/frontend/app/src/store/main.ts:31:53)
          at fulfilled (/Users/raphaelosazeeyerin/Desktop/Sphinx/sphinx-tribes/frontend/app/src/store/main.ts:22:58)
          at processTicksAndRejections (node:internal/process/task_queues:96:5)

Can you take a look? it has as a result of response.status being undefined when you called saveBounty from the test, and is there a reason you preferred Jest Mock to Sinon Stub?

@Jeezman
Copy link
Contributor Author

Jeezman commented Nov 27, 2023

@elraphty addressed here a202dfa

We already use jest mock in the codebase

jest.mock('react-router-dom', () => ({
...jest.requireActual('react-router-dom'),
useHistory: () => ({
push: mockHistoryPush

@elraphty elraphty merged commit a42bb4d into stakwork:master Nov 28, 2023
5 checks passed
elraphty added a commit that referenced this pull request Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bounty Homepage-Signed In] Create mock data for unit tests on homepage
2 participants