@@ -2042,36 +2042,34 @@ describe('umnount', () => {
2042
2042
} )
2043
2043
2044
2044
it ( 'unsubscribes from a facet (via a fast-* component) inserted using insertBefore, when the parent is unmounted' , ( ) => {
2045
- it ( 'unsubscribes from all facets when a elements are swapped' , ( ) => {
2046
- const unsubscribe = jest . fn ( )
2045
+ const unsubscribe = jest . fn ( )
2047
2046
2048
- const facet : Facet < string > = {
2049
- get : ( ) => 'abc' ,
2050
- observe : jest . fn ( ) . mockReturnValue ( unsubscribe ) ,
2051
- }
2047
+ const facet : Facet < string > = {
2048
+ get : ( ) => 'abc' ,
2049
+ observe : jest . fn ( ) . mockReturnValue ( unsubscribe ) ,
2050
+ }
2052
2051
2053
- const TestComponent = ( { show, facet } : { facet : Facet < string > ; show ?: boolean } ) => (
2054
- < div >
2055
- { show ? < fast-text text = { facet } /> : null }
2056
- < div />
2057
- </ div >
2058
- )
2052
+ const TestComponent = ( { show, facet } : { facet : Facet < string > ; show ?: boolean } ) => (
2053
+ < div >
2054
+ { show ? < fast-text text = { facet } /> : null }
2055
+ < div />
2056
+ </ div >
2057
+ )
2059
2058
2060
- render ( < TestComponent facet = { facet } /> )
2059
+ render ( < TestComponent facet = { facet } /> )
2061
2060
2062
- expect ( facet . observe ) . toHaveBeenCalledTimes ( 0 )
2063
- expect ( unsubscribe ) . toHaveBeenCalledTimes ( 0 )
2061
+ expect ( facet . observe ) . toHaveBeenCalledTimes ( 0 )
2062
+ expect ( unsubscribe ) . toHaveBeenCalledTimes ( 0 )
2064
2063
2065
- render ( < TestComponent facet = { facet } show /> )
2064
+ render ( < TestComponent facet = { facet } show /> )
2066
2065
2067
- expect ( facet . observe ) . toHaveBeenCalledTimes ( 1 )
2068
- expect ( unsubscribe ) . toHaveBeenCalledTimes ( 0 )
2066
+ expect ( facet . observe ) . toHaveBeenCalledTimes ( 1 )
2067
+ expect ( unsubscribe ) . toHaveBeenCalledTimes ( 0 )
2069
2068
2070
- render ( < > </ > )
2069
+ render ( < > </ > )
2071
2070
2072
- expect ( facet . observe ) . toHaveBeenCalledTimes ( 1 )
2073
- expect ( unsubscribe ) . toHaveBeenCalledTimes ( 1 )
2074
- } )
2071
+ expect ( facet . observe ) . toHaveBeenCalledTimes ( 1 )
2072
+ expect ( unsubscribe ) . toHaveBeenCalledTimes ( 1 )
2075
2073
} )
2076
2074
2077
2075
it ( 'keeps the subscription of facets when moving in a keyed list' , ( ) => {
0 commit comments