File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import {
11
11
SEARCH_NARROW ,
12
12
streamNarrow ,
13
13
topicNarrow ,
14
+ pm1to1NarrowFromUser ,
14
15
} from '../../utils/narrow' ;
15
16
import { objectFromEntries } from '../../jsBackport' ;
16
17
@@ -59,23 +60,24 @@ describe('caughtUpReducer', () => {
59
60
// MESSAGE_FETCH_START applies the identity function to the
60
61
// state (i.e., it doesn't do anything to it). Reversing that
61
62
// effect is also done with the identity function.
62
- const initialState = deepFreeze ( {
63
- [ HOME_NARROW_STR ] : {
64
- older : true ,
65
- newer : true ,
66
- } ,
67
- } ) ;
63
+
64
+ const narrow1 = pm1to1NarrowFromUser ( eg . otherUser ) ;
65
+ const narrow2 = pm1to1NarrowFromUser ( eg . thirdUser ) ;
66
+
67
+ // Include some other narrow to test that the reducer doesn't go mess
68
+ // something up there.
69
+ const initialState = deepFreeze ( { [ keyFromNarrow ( narrow1 ) ] : { older : true , newer : true } } ) ;
68
70
69
71
const messageFetchStartAction = deepFreeze ( {
70
72
...eg . action . message_fetch_start ,
71
- narrow : HOME_NARROW ,
73
+ narrow : narrow2 ,
72
74
} ) ;
73
75
74
76
const state1 = caughtUpReducer ( initialState , messageFetchStartAction ) ;
75
77
76
78
const messageFetchErrorAction = deepFreeze ( {
77
79
type : MESSAGE_FETCH_ERROR ,
78
- narrow : HOME_NARROW ,
80
+ narrow : narrow2 ,
79
81
error : new Error ( ) ,
80
82
} ) ;
81
83
You can’t perform that action at this time.
0 commit comments