@@ -11,7 +11,8 @@ class ChatThreadListViewModel_Tests: StreamChatTestCase {
11
11
12
12
func test_viewDidAppear_thenLoadsThreads( ) {
13
13
let mockThreadListController = ChatThreadListController_Mock . mock (
14
- query: . init( watch: true )
14
+ query: . init( watch: true ) ,
15
+ client: . mock( isLocalStorageEnabled: false )
15
16
)
16
17
let viewModel = ChatThreadListViewModel (
17
18
threadListController: mockThreadListController
@@ -23,7 +24,8 @@ class ChatThreadListViewModel_Tests: StreamChatTestCase {
23
24
24
25
func test_viewDidAppear_whenAlreadyLoadedThreads_thenDoesNotLoadsThreads( ) {
25
26
let mockThreadListController = ChatThreadListController_Mock . mock (
26
- query: . init( watch: true )
27
+ query: . init( watch: true ) ,
28
+ client: . mock( isLocalStorageEnabled: false )
27
29
)
28
30
let viewModel = ChatThreadListViewModel (
29
31
threadListController: mockThreadListController
@@ -38,7 +40,8 @@ class ChatThreadListViewModel_Tests: StreamChatTestCase {
38
40
39
41
func test_loadThreads_whenInitialEmptyData_whenSuccess( ) {
40
42
let mockThreadListController = ChatThreadListController_Mock . mock (
41
- query: . init( watch: true )
43
+ query: . init( watch: true ) ,
44
+ client: . mock( isLocalStorageEnabled: false )
42
45
)
43
46
mockThreadListController. threads_mock = [ ]
44
47
let viewModel = ChatThreadListViewModel (
@@ -64,7 +67,8 @@ class ChatThreadListViewModel_Tests: StreamChatTestCase {
64
67
65
68
func test_loadThreads_whenCacheAvailable_whenSuccess( ) {
66
69
let mockThreadListController = ChatThreadListController_Mock . mock (
67
- query: . init( watch: true )
70
+ query: . init( watch: true ) ,
71
+ client: . mock( isLocalStorageEnabled: false )
68
72
)
69
73
mockThreadListController. threads_mock = [ . mock( ) ]
70
74
let viewModel = ChatThreadListViewModel (
@@ -90,7 +94,8 @@ class ChatThreadListViewModel_Tests: StreamChatTestCase {
90
94
91
95
func test_loadThreads_whenError( ) {
92
96
let mockThreadListController = ChatThreadListController_Mock . mock (
93
- query: . init( watch: true )
97
+ query: . init( watch: true ) ,
98
+ client: . mock( isLocalStorageEnabled: false )
94
99
)
95
100
mockThreadListController. threads_mock = [ ]
96
101
let viewModel = ChatThreadListViewModel (
@@ -110,7 +115,8 @@ class ChatThreadListViewModel_Tests: StreamChatTestCase {
110
115
111
116
func test_didAppearThread_whenInsideThreshold_thenLoadMoreThreads( ) {
112
117
let mockThreadListController = ChatThreadListController_Mock . mock (
113
- query: . init( watch: true )
118
+ query: . init( watch: true ) ,
119
+ client: . mock( isLocalStorageEnabled: false )
114
120
)
115
121
let viewModel = ChatThreadListViewModel (
116
122
threadListController: mockThreadListController
@@ -131,7 +137,8 @@ class ChatThreadListViewModel_Tests: StreamChatTestCase {
131
137
132
138
func test_didAppearThread_whenNotInThreshold_thenDoNotLoadMoreThreads( ) {
133
139
let mockThreadListController = ChatThreadListController_Mock . mock (
134
- query: . init( watch: true )
140
+ query: . init( watch: true ) ,
141
+ client: . mock( isLocalStorageEnabled: false )
135
142
)
136
143
let viewModel = ChatThreadListViewModel (
137
144
threadListController: mockThreadListController
@@ -152,7 +159,8 @@ class ChatThreadListViewModel_Tests: StreamChatTestCase {
152
159
153
160
func test_didReceiveThreadMessageNewEvent( ) {
154
161
let mockThreadListController = ChatThreadListController_Mock . mock (
155
- query: . init( watch: true )
162
+ query: . init( watch: true ) ,
163
+ client: . mock( isLocalStorageEnabled: false )
156
164
)
157
165
let viewModel = ChatThreadListViewModel (
158
166
threadListController: mockThreadListController
0 commit comments