File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
projects/angular-redux/src/tests Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 1+ import { createStore } from 'redux'
2+ import {
3+ injectDispatch , provideRedux
4+ } from '../public-api'
5+ import { Component } from "@angular/core" ;
6+ import { render } from "@testing-library/angular" ;
7+
8+ const store = createStore ( ( c : number = 1 ) : number => c + 1 )
9+ const store2 = createStore ( ( c : number = 1 ) : number => c + 2 )
10+
11+ describe ( 'injectDispatch' , ( ) => {
12+ it ( "returns the store's dispatch function" , async ( ) => {
13+ @Component ( {
14+ selector : "app-root" ,
15+ standalone : true ,
16+ template : "<p></p>"
17+ } )
18+ class Testing {
19+ dispatch = injectDispatch ( ) ;
20+ }
21+
22+ const result = await render ( Testing , {
23+ providers : [ provideRedux ( { store} ) ]
24+ } )
25+
26+ expect ( result . fixture . componentRef . instance . dispatch ) . toBe ( store . dispatch )
27+ } )
28+ } )
You can’t perform that action at this time.
0 commit comments