-
Notifications
You must be signed in to change notification settings - Fork 57
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
Pathify and Jest tests (w/ Vue Test Utils) #45
Comments
Hmm. Perhaps there is something that is different in test utils? Let me look into this. |
Also, have you tried NOT using wildcards? What happens then? Did you check the wildcards section of the docs? https://davestewart.github.io/vuex-pathify/#/api/component?id=troubleshooting-wildcards |
@davestewart Sorry, I have completely forgotten I've posted this issue and didn't pay attention to the notifications 😞 I'll try your suggestion today and see if anything changes. |
Any updates @liliumdev ? |
This might be related to this issue; I'll look into it this week or next: |
@davestewart I tried it without the wildcards, and explicitly accessed the needed getters from the store and that worked. We are needing to be able to test with jest and cypress with the wildcard for most of our views have many fields. Do you have a solution for this error? |
Hey @jcaruthersjr - I don't TBH. Testing is not really my forte, but I would be happy to look into it. Can you post a small repo for me to examine? You could fork the existing simple demo and just add some tests I presume... |
Ugh, again this issue I've created dropped off my radar. @davestewart It didn't work without wildcards either for me. We dropped Jest tests since then lol, but let me know if I can do some other tests if you want to resolve this. |
@davestewart https://codesandbox.io/s/admin-test-9re3z?fontsize=14&hidenavigation=1&theme=dark if you uncomment the computed section of the databases-config.vue // databases: get("databases"), |
I've run into an issue while trying to write tests for a component utilizing Pathify. The component itself doesn't define any complex paths, just a wildcard
...sync('GuestList/*'),
as acomputed
property.Most of the test can be condensed to the following:
When running the tests, the error being thrown by Pathify is:
It seems that this error happens when the store is actually not yet initialized, according to this
vuex-pathify/src/services/wildcards.js
Line 126 in 9179968
mount
method from Vue Test Utils.Has anyone encountered this issue before and managed to resolve it? I don't think mocking the entire store either is an option because Pathify would still fail on the line above.
The text was updated successfully, but these errors were encountered: