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

🚀[FEATURE]: Add test helper for @Select #533

Closed
wouterv opened this issue Aug 2, 2018 · 4 comments
Closed

🚀[FEATURE]: Add test helper for @Select #533

wouterv opened this issue Aug 2, 2018 · 4 comments

Comments

@wouterv
Copy link

wouterv commented Aug 2, 2018

Feature Request

When I am unit testing my components that use a store, I often just want to mock the store to check whether the right dispatch methods were called.

However when the component contains @select you'll get a errors like:

Error: SelectFactory not connected to store!

Now we can use ugly hacks like the following to get rid of the errors:

Object.defineProperty(component, 'active$', { writable: true });
component.active$ = of([]);

But it would be nicer if we have the ability to have some helpers to mock the selects, or let the SelectFactory be mockable somehow.

See also: #482

@markwhitfeld
Copy link
Member

I agree that this is very much needed.
Could you propose what you would like this testing api to look like?

@SarikaVanapalli
Copy link

Is there a way to mock @select options in an angular component with mock store? I don't see much documentation around this anywhere.

@splincode
Copy link
Member

This problem is now considered here: ngxs-labs/testing#4

@arturovt arturovt self-assigned this Oct 13, 2019
@arturovt arturovt removed their assignment Oct 23, 2019
@splincode splincode changed the title Add test helper for @Select 🚀[FEATURE]: Add test helper for @Select Nov 4, 2019
@arturovt
Copy link
Member

arturovt commented Aug 2, 2022

We have deprecated the select decorator since it has issues with the SelectFactory (it basically served as a service locator). No more work is going to be done for the select decorator.

@arturovt arturovt closed this as completed Aug 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants