Skip to content

Commit 556f34c

Browse files
committed
fix oauth select account dialog
1 parent f03faa6 commit 556f34c

File tree

3 files changed

+31
-16
lines changed

3 files changed

+31
-16
lines changed

redisinsight/ui/src/components/oauth/oauth-select-account-dialog/OAuthSelectAccountDialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ import {
4444
} from 'uiSrc/components/base/forms/radio-group/RadioGroup'
4545
import { Spacer } from 'uiSrc/components/base/layout/spacer'
4646
import { Modal } from 'uiSrc/components/base/display'
47-
import styles from './styles.module.scss'
4847
import { CancelIcon } from 'uiSrc/components/base/icons'
48+
import styles from './styles.module.scss'
4949

5050
interface FormValues {
5151
accountId: Nullable<string>

redisinsight/ui/src/components/oauth/oauth-select-plan/OAuthSelectPlan.spec.tsx

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,24 @@ jest.mock('uiSrc/slices/app/features', () => ({
6262
}),
6363
}))
6464

65+
jest.mock('uiSrc/components/base/display', () => {
66+
const actual = jest.requireActual('uiSrc/components/base/display')
67+
68+
return {
69+
...actual,
70+
Modal: {
71+
...actual.Modal,
72+
Content: {
73+
...actual.Modal.Content,
74+
Header: {
75+
...actual.Modal.Content.Header,
76+
Title: jest.fn().mockReturnValue(null),
77+
},
78+
},
79+
},
80+
}
81+
})
82+
6583
let store: typeof mockedStore
6684
beforeEach(() => {
6785
cleanup()
@@ -97,9 +115,7 @@ describe('OAuthSelectPlan', () => {
97115

98116
const { queryByTestId } = render(<OAuthSelectPlan />)
99117

100-
const closeEl = queryByTestId('oauth-select-plan-dialog')?.querySelector(
101-
'.euiModal__closeIcon',
102-
)
118+
const closeEl = queryByTestId('oauth-select-plan-dialog-close-btn')
103119

104120
fireEvent.click(closeEl as HTMLButtonElement)
105121

redisinsight/ui/src/components/oauth/oauth-select-plan/OAuthSelectPlan.tsx

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import { ColorText, Text } from 'uiSrc/components/base/text'
2626
import { RiIcon } from 'uiSrc/components/base/icons/RiIcon'
2727
import { RiSelect } from 'uiSrc/components/base/forms/select/RiSelect'
2828
import { Modal } from 'uiSrc/components/base/display'
29+
import { CancelIcon } from 'uiSrc/components/base/icons'
2930
import { CloudSubscriptionPlanResponse } from 'apiSrc/modules/cloud/subscription/dto'
3031
import { OAuthProvider, OAuthProviders } from './constants'
3132
import styles from './styles.module.scss'
@@ -171,15 +172,13 @@ const OAuthSelectPlan = () => {
171172
}
172173

173174
return (
174-
<Modal
175-
open
176-
width="fit-content"
177-
className={styles.container}
178-
onCancel={handleOnClose}
179-
data-testid="oauth-select-plan-dialog"
180-
title="Choose a cloud vendor"
181-
content={
182-
<>
175+
<Modal.Compose open>
176+
<Modal.Content.Compose className={styles.container} data-testid="oauth-select-plan-dialog">
177+
<Modal.Content.Close icon={CancelIcon} onClick={handleOnClose} data-testid="oauth-select-plan-dialog-close-btn" />
178+
<Modal.Content.Header.Title>
179+
Choose a cloud vendor
180+
</Modal.Content.Header.Title>
181+
<Modal.Content.Body.Compose width="fit-content">
183182
<section className={styles.content}>
184183
<Text className={styles.subTitle}>
185184
Select a cloud vendor and region to complete the final step
@@ -257,9 +256,9 @@ const OAuthSelectPlan = () => {
257256
</PrimaryButton>
258257
</footer>
259258
</section>
260-
</>
261-
}
262-
/>
259+
</Modal.Content.Body.Compose>
260+
</Modal.Content.Compose>
261+
</Modal.Compose>
263262
)
264263
}
265264

0 commit comments

Comments
 (0)