Skip to content

Commit 2d7b6a4

Browse files
committed
fix OAuthCreateDb.spec.tsx
1 parent feb0f92 commit 2d7b6a4

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

redisinsight/ui/src/components/oauth/oauth-sso/oauth-create-db/OAuthCreateDb.spec.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { cloneDeep } from 'lodash'
33
import {
44
act,
55
cleanup,
6+
expectActionsToContain,
67
fireEvent,
78
mockedStore,
89
render,
@@ -86,7 +87,7 @@ describe('OAuthCreateDb', () => {
8687

8788
expect(screen.getByTestId('sso-email')).toBeInTheDocument()
8889

89-
expect(sendEventTelemetry).toBeCalledWith({
90+
expect(sendEventTelemetry).toHaveBeenCalledWith({
9091
event: TelemetryEvent.CLOUD_SIGN_IN_SOCIAL_ACCOUNT_SELECTED,
9192
eventData: {
9293
accountOption: OAuthStrategy.SSO,
@@ -107,7 +108,7 @@ describe('OAuthCreateDb', () => {
107108
fireEvent.click(screen.getByTestId('btn-submit'))
108109
})
109110

110-
expect(sendEventTelemetry).toBeCalledWith({
111+
expect(sendEventTelemetry).toHaveBeenCalledWith({
111112
event: TelemetryEvent.CLOUD_SIGN_IN_SSO_OPTION_PROCEEDED,
112113
eventData: {
113114
action: OAuthSocialAction.Create,
@@ -124,7 +125,7 @@ describe('OAuthCreateDb', () => {
124125

125126
fireEvent.click(screen.getByTestId('google-oauth'))
126127

127-
expect(sendEventTelemetry).toBeCalledWith({
128+
expect(sendEventTelemetry).toHaveBeenCalledWith({
128129
event: TelemetryEvent.CLOUD_SIGN_IN_SOCIAL_ACCOUNT_SELECTED,
129130
eventData: {
130131
accountOption: OAuthStrategy.Google,
@@ -174,7 +175,7 @@ describe('OAuthCreateDb', () => {
174175
expect(store.getActions()).toEqual(expectedActions)
175176
})
176177

177-
it('should call proper actions after click create without recommened settings', async () => {
178+
it('should call proper actions after click create without recommended settings', async () => {
178179
;(oauthCloudUserSelector as jest.Mock).mockReturnValue({ data: {} })
179180
render(<OAuthCreateDb />)
180181

@@ -193,6 +194,6 @@ describe('OAuthCreateDb', () => {
193194
setSocialDialogState(null),
194195
getPlans(),
195196
]
196-
expect(store.getActions()).toEqual(expectedActions)
197+
expectActionsToContain(store.getActions(), expectedActions)
197198
})
198199
})

redisinsight/ui/src/mocks/handlers/oauth/cloud.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ const handlers: HttpHandler[] = [
2626
http.get(getMswURL(ApiEndpoints.CLOUD_ME), async () => {
2727
return HttpResponse.json(CLOUD_ME_DATA_MOCK, { status: 200 })
2828
}),
29+
http.get(getMswURL(ApiEndpoints.CLOUD_SUBSCRIPTION_PLANS), async () => {
30+
return HttpResponse.json(CLOUD_ME_DATA_MOCK, { status: 200 })
31+
}),
32+
http.post(getMswURL(ApiEndpoints.CLOUD_ME_JOBS), async () => {
33+
return HttpResponse.json(CLOUD_ME_DATA_MOCK, { status: 200 })
34+
}),
2935
]
3036

3137
export default handlers

0 commit comments

Comments
 (0)