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

feat: add msw alternative for mocking #169

Merged
merged 11 commits into from
Oct 31, 2023

Conversation

spaenleh
Copy link
Member

@spaenleh spaenleh commented Aug 28, 2023

TODO:

  • check that permissions are applied as expected
  • handle appData visibility between item and member

Changes:

  • Uses the useQueryClient hook instead of passing it as an instance when creating the hooks
  • Added a new netting in the queryClient config: standalone: when true , the context and tokens are supplied by the app itself, no mock post-message
  • Add a select for the mocking solution
  • Add the appContext in the Database
  • Remove mockParentWindow
  • Add a GraaspDevTools Component

@spaenleh spaenleh linked an issue Aug 28, 2023 that may be closed by this pull request
@spaenleh spaenleh added feature New feature or request improvement labels Sep 1, 2023
@spaenleh spaenleh force-pushed the 159-add-msw-alternative-for-mocking branch from 520ceae to c52d0f6 Compare September 1, 2023 13:52
Copy link
Contributor

@pyphilia pyphilia left a comment

Choose a reason for hiding this comment

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

LGTM! Nice work^^ 🍾

test/constants.ts Outdated Show resolved Hide resolved
test/wsUtils.tsx Outdated Show resolved Hide resolved
src/components/GraaspContextDevTool.tsx Show resolved Hide resolved
src/components/utils/hooks.ts Show resolved Hide resolved
src/mockServer/mockServer.ts Outdated Show resolved Hide resolved
src/mockServer/msw-browser.ts Outdated Show resolved Hide resolved
src/mockServer/msw-browser.ts Outdated Show resolved Hide resolved
src/mockServer/msw-handlers.ts Outdated Show resolved Hide resolved
src/types.ts Outdated Show resolved Hide resolved
@spaenleh spaenleh force-pushed the 159-add-msw-alternative-for-mocking branch 3 times, most recently from 63065e4 to 8486cc9 Compare October 13, 2023 06:54
@spaenleh spaenleh force-pushed the 159-add-msw-alternative-for-mocking branch from 02ebcc9 to 7d1d628 Compare October 20, 2023 06:43
fix: invalidate localcontext instead of parent context

fix: create an endpoint to get the context from the mocks

fix: get mock context

fix: save context

fix: update position of toolbox

fix: use getLocalcontext data

fix: get token from cache

fix: local context

fix: disabled test for postmessage

chore: update lockfile

fix: post setting

fix: permission

fix: move mocking solutions in their own folder and cleanup

fix: apply PR comments
@spaenleh spaenleh force-pushed the 159-add-msw-alternative-for-mocking branch from 0768ed3 to 9a0985a Compare October 27, 2023 07:36
@spaenleh spaenleh force-pushed the 159-add-msw-alternative-for-mocking branch from 54c2f6d to 3fa0aa4 Compare October 27, 2023 08:24
src/hooks/postMessage.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@pyphilia pyphilia left a comment

Choose a reason for hiding this comment

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

I've added mainly style comments, good work! 🥬

src/api/appSetting.ts Outdated Show resolved Hide resolved
src/hooks/postMessage.test.ts Show resolved Hide resolved
src/hooks/postMessage.test.ts Outdated Show resolved Hide resolved
src/hooks/postMessage.ts Outdated Show resolved Hide resolved
src/hooks/postMessage.ts Outdated Show resolved Hide resolved
src/hooks/postMessage.ts Outdated Show resolved Hide resolved
src/mockServer/msw/dexie-db.ts Outdated Show resolved Hide resolved
src/mockServer/msw/handlers.ts Show resolved Hide resolved
test/utils.tsx Outdated Show resolved Hide resolved
@spaenleh spaenleh force-pushed the 159-add-msw-alternative-for-mocking branch from 44ce32a to de11cd0 Compare October 31, 2023 14:19
@spaenleh spaenleh force-pushed the 159-add-msw-alternative-for-mocking branch from ff3ed30 to e6cc7f2 Compare October 31, 2023 14:35
@spaenleh spaenleh removed the request for review from codeofmochi October 31, 2023 14:48
@spaenleh spaenleh merged commit 4ddc15f into main Oct 31, 2023
2 checks passed
@spaenleh spaenleh deleted the 159-add-msw-alternative-for-mocking branch December 4, 2023 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request improvement v3.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add MSW alternative for mocking
2 participants