Trouble switching tests from vuex to pinia #1682
Unanswered
fancyfootwork
asked this question in
Help and Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have converted my app from vuex to pinia and now I'm rewriting my tests. I've tried several things, but I keep getting errors when trying to use a mock store. Here are the original tests that work:
Here are the pinia tests where the mocked store tests don't work:
Here are the results:
FAIL tests/unit/RegisterUserSuccess.spec.js
● RegisterUserSuccess › page content › is rendered with user first name when available
● RegisterUserSuccess › page content › is rendered with user email when available
...It seems as though the mock authentication store isn't being used.
I think this specific part is not correct:
I got that code from here: #101 (comment)
but I guess I'm implementing it wrong?
I also tried adding the store with a lowercase a (as it is defined in the component):
Still no dice.
If anyone could tell me what I'm doing wrong I would greatly appreciate it!
Beta Was this translation helpful? Give feedback.
All reactions