Skip to content
This repository has been archived by the owner on May 27, 2020. It is now read-only.

Add test helper for @Select #4

Open
splincode opened this issue May 29, 2019 · 4 comments
Open

Add test helper for @Select #4

splincode opened this issue May 29, 2019 · 4 comments

Comments

@splincode
Copy link
Member

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

@splincode
Copy link
Member Author

@aymeric-duchein Could you help with this issue?

@aymeric-duchein
Copy link
Contributor

I'll look into it, we might be able to provide a function that takes a selector and returns a Subject to allow you to trigger the component observable when you choose to.

@aymeric-duchein
Copy link
Contributor

@splincode do you know when this could be published?

@splincode
Copy link
Member Author

@aymeric-duchein published

@splincode splincode reopened this Jan 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants