Skip to content

Commit dddf509

Browse files
committed
fix init.spec.ts to reflect error from axios
1 parent 19bafbf commit dddf509

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

redisinsight/ui/src/slices/tests/app/init.spec.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import {
2424
getFeatureFlags,
2525
getFeatureFlagsFailure,
2626
getFeatureFlagsSuccess,
27-
setFeaturesToHighlight,
2827
} from 'uiSrc/slices/app/features'
2928
import { getConfig } from 'uiSrc/config'
3029
import {
@@ -157,15 +156,10 @@ describe('init slice', () => {
157156
it('failed to init csrf', async () => {
158157
riConfig.api.csrfEndpoint = 'csrf'
159158
mswServer.use(
160-
http.get<any, CSRFTokenResponse>(
159+
http.get<any, CSRFTokenResponse | { message: string }>(
161160
getMswURL(riConfig.api.csrfEndpoint),
162161
async () => {
163-
return HttpResponse.json(
164-
{
165-
message: 'Network Error',
166-
},
167-
{ status: 500 },
168-
)
162+
return HttpResponse.text('', { status: 500 })
169163
},
170164
),
171165
)
@@ -177,7 +171,7 @@ describe('init slice', () => {
177171
const expectedActions = [
178172
initializeAppState(),
179173
fetchCsrfToken(),
180-
fetchCsrfTokenFail({ error: 'Network Error' }),
174+
fetchCsrfTokenFail({ error: 'Request failed with status code 500' }),
181175
initializeAppStateFail({ error: FAILED_TO_FETCH_CSRF_TOKEN_ERROR }),
182176
]
183177

0 commit comments

Comments
 (0)