1
1
import { Component } from '@angular/core' ;
2
2
import { TestBed } from '@angular/core/testing' ;
3
3
import { of } from 'rxjs' ;
4
- import { RxStateSetupFn , rxState } from './inject ' ;
4
+ import { RxStateSetupFn , rxState } from './rx-state ' ;
5
5
6
6
describe ( rxState , ( ) => {
7
- it ( 'should create RxState instance ' , ( ) => {
7
+ it ( 'should create rxState ' , ( ) => {
8
8
const { component } = setupComponent ( ) ;
9
9
expect ( component . state ) . toBeDefined ( ) ;
10
10
} ) ;
@@ -27,30 +27,6 @@ describe(rxState, () => {
27
27
expect ( component . state . get ( ) ) . toEqual ( { count : 20 } ) ;
28
28
} ) ;
29
29
30
- /*it('should hold an observable', () => {
31
- const spy = jest.fn();
32
- setupComponent<{ count: number }>(({ hold }) =>
33
- hold(of('src').pipe(tap(spy)))
34
- );
35
- expect(spy).toHaveBeenCalledWith('src');
36
- });
37
-
38
- it('should hold an observable and sideEffect fn', () => {
39
- const spy = jest.fn();
40
- setupComponent<{ count: number }>(({ hold }) => hold(of('src'), spy));
41
- expect(spy).toHaveBeenCalledWith('src');
42
- });
43
-
44
- it('should hold multiple observables', () => {
45
- const spy = jest.fn();
46
- setupComponent<{ count: number }>(({ hold }) => {
47
- hold(of('src').pipe(tap(spy)));
48
- hold(of('src2'), spy);
49
- });
50
- expect(spy.mock.calls[0][0]).toEqual('src');
51
- expect(spy.mock.calls[1][0]).toEqual('src2');
52
- });*/
53
-
54
30
it ( 'should connect with slice$' , ( ) => {
55
31
const { component } = setupComponent < { count : number } > ( ( { connect } ) =>
56
32
connect ( of ( { count : 10 } ) )
0 commit comments