Skip to content

Commit 4aa89ce

Browse files
committed
test: update test according to paragon updates
1 parent 42b5a4a commit 4aa89ce

5 files changed

Lines changed: 67 additions & 42 deletions

File tree

.env.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,4 @@ APP_ID=
3131
MFE_CONFIG_API_URL=
3232
LEARNER_FEEDBACK_URL=''
3333
SUPPORT_URL_TO_UNLINK_SOCIAL_MEDIA_ACCOUNT='https://help.edx.org/edxlearner/s/article/How-do-I-link-or-unlink-my-edX-account-to-a-social-media-account'
34+
PARAGON_THEME_URLS={}

src/account-settings/delete-account/__snapshots__/BeforeProceedingBanner.test.jsx.snap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ exports[`BeforeProceedingBanner should match the snapshot when SUPPORT_URL_TO_UN
5757
<a
5858
className="pgn__hyperlink default-link standalone-link"
5959
href="http://test-support.edx"
60-
onClick={[Function]}
6160
target="_self"
6261
>
6362
unlink all social media accounts

src/account-settings/delete-account/__snapshots__/ConfirmationModal.test.jsx.snap

Lines changed: 61 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -131,30 +131,57 @@ exports[`ConfirmationModal should match empty password confirmation modal snapsh
131131
</div>
132132
</div>
133133
<div
134-
className="form-group"
135-
data-testid="validation-form-group"
134+
className="pgn__form-group"
135+
for="passwordFieldId"
136136
>
137+
<div
138+
className="pgn__form-control-description pgn__form-text pgn__form-text-invalid"
139+
feedback-for="passwordFieldId"
140+
id="form-field3-4"
141+
>
142+
<span
143+
className="pgn__icon"
144+
>
145+
<svg
146+
aria-hidden={true}
147+
fill="none"
148+
focusable={false}
149+
height={24}
150+
role="img"
151+
viewBox="0 0 24 24"
152+
width={24}
153+
xmlns="http://www.w3.org/2000/svg"
154+
>
155+
<path
156+
d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41Z"
157+
fill="currentColor"
158+
/>
159+
</svg>
160+
</span>
161+
<div>
162+
A password is required
163+
</div>
164+
</div>
137165
<label
138-
className="d-block"
139-
htmlFor="passwordFieldId"
166+
className="pgn__form-label d-block"
167+
htmlFor="form-field3"
140168
>
141169
If you still wish to continue and delete your account, please enter your account password:
142170
</label>
143-
<input
144-
aria-describedby="passwordFieldId-invalid-feedback"
145-
className="form-control is-invalid"
146-
id="passwordFieldId"
147-
name="password"
148-
onChange={[MockFunction]}
149-
type="password"
150-
value="fluffy bunnies"
151-
/>
152-
<strong
153-
className="invalid-feedback"
154-
id="passwordFieldId-invalid-feedback"
171+
<div
172+
className="pgn__form-control-decorator-group"
155173
>
156-
A password is required
157-
</strong>
174+
<input
175+
aria-describedby="form-field3-4"
176+
className="has-value form-control is-invalid"
177+
id="form-field3"
178+
name="password"
179+
onBlur={[Function]}
180+
onChange={[Function]}
181+
type="password"
182+
value="fluffy bunnies"
183+
/>
184+
</div>
158185
</div>
159186
</div>
160187
</div>
@@ -299,30 +326,28 @@ exports[`ConfirmationModal should match open confirmation modal snapshot 1`] = `
299326
</div>
300327
</div>
301328
<div
302-
className="form-group"
303-
data-testid="validation-form-group"
329+
className="pgn__form-group"
330+
for="passwordFieldId"
304331
>
305332
<label
306-
className="d-block"
307-
htmlFor="passwordFieldId"
333+
className="pgn__form-label d-block"
334+
htmlFor="form-field1"
308335
>
309336
If you still wish to continue and delete your account, please enter your account password:
310337
</label>
311-
<input
312-
aria-describedby=""
313-
className="form-control"
314-
id="passwordFieldId"
315-
name="password"
316-
onChange={[MockFunction]}
317-
type="password"
318-
value="fluffy bunnies"
319-
/>
320-
<strong
321-
className="invalid-feedback"
322-
id="passwordFieldId-invalid-feedback"
338+
<div
339+
className="pgn__form-control-decorator-group"
323340
>
324-
Unable to delete account
325-
</strong>
341+
<input
342+
className="has-value form-control"
343+
id="form-field1"
344+
name="password"
345+
onBlur={[Function]}
346+
onChange={[Function]}
347+
type="password"
348+
value="fluffy bunnies"
349+
/>
350+
</div>
326351
</div>
327352
</div>
328353
</div>

src/account-settings/delete-account/__snapshots__/DeleteAccount.test.jsx.snap

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ exports[`DeleteAccount should match default section snapshot 1`] = `
2828
<a
2929
className="pgn__hyperlink default-link standalone-link"
3030
href="https://help.edx.org/edxlearner/s/topic/0TOQq0000001UdZOAU/account-basics"
31-
onClick={[Function]}
3231
target="_self"
3332
>
3433
Want to change your email, name, or password instead?
@@ -75,7 +74,6 @@ exports[`DeleteAccount should match unverified account section snapshot 1`] = `
7574
<a
7675
className="pgn__hyperlink default-link standalone-link"
7776
href="https://help.edx.org/edxlearner/s/topic/0TOQq0000001UdZOAU/account-basics"
78-
onClick={[Function]}
7977
target="_self"
8078
>
8179
Want to change your email, name, or password instead?
@@ -118,7 +116,6 @@ exports[`DeleteAccount should match unverified account section snapshot 1`] = `
118116
<a
119117
className="pgn__hyperlink default-link standalone-link"
120118
href="https://support.edx.org/hc/en-us/articles/115000940568-How-do-I-confirm-my-email"
121-
onClick={[Function]}
122119
target="_self"
123120
>
124121
activate your account
@@ -157,7 +154,6 @@ exports[`DeleteAccount should match unverified account section snapshot 2`] = `
157154
<a
158155
className="pgn__hyperlink default-link standalone-link"
159156
href="https://help.edx.org/edxlearner/s/topic/0TOQq0000001UdZOAU/account-basics"
160-
onClick={[Function]}
161157
target="_self"
162158
>
163159
Want to change your email, name, or password instead?
@@ -200,7 +196,6 @@ exports[`DeleteAccount should match unverified account section snapshot 2`] = `
200196
<a
201197
className="pgn__hyperlink default-link standalone-link"
202198
href="https://help.edx.org/edxlearner/s/article/How-do-I-link-or-unlink-my-edX-account-to-a-social-media-account"
203-
onClick={[Function]}
204199
target="_self"
205200
>
206201
unlink all social media accounts

src/setupTest.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,8 @@ jest.mock('@openedx/frontend-plugin-framework', () => ({
99
Plugin: () => 'Plugin',
1010
PluginSlot: MockedPluginSlot,
1111
}));
12+
13+
jest.mock('@edx/frontend-platform/react/hooks', () => ({
14+
...jest.requireActual('@edx/frontend-platform/react/hooks'),
15+
useParagonTheme: () => [{ isThemeLoaded: true }, jest.fn()],
16+
}));

0 commit comments

Comments
 (0)