Skip to content

Commit f3e549e

Browse files
committed
Fixing unit tests
1 parent 0823e31 commit f3e549e

8 files changed

Lines changed: 47 additions & 6 deletions

File tree

src/display/shared/modals/ModalContainer.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,10 @@ const ModalContainer = (props) => {
248248
headerText="Really Delete Account?"
249249
bodyText={
250250
<span>
251-
Are you sure you want to delete your account? <strong>This action cannot be undone.</strong>{' '}
252-
You will be unable to access any tracked characters or threads in the future,{' '}
253-
unless you create a new account and re-add them.
251+
Are you sure you want to delete your account?{' '}
252+
<strong>This action cannot be undone.</strong> You will be unable to access
253+
any tracked characters or threads in the future, unless you create a new
254+
account and re-add them.
254255
</span>
255256
}
256257
/>

src/display/shared/modals/__tests__/__snapshots__/ModalContainer.spec.js.snap

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,22 @@ exports[`rendering snapshots should render valid snapshot 1`] = `
212212
submitButtonText="Delete Tag"
213213
submitCallback={[MockFunction]}
214214
/>
215+
<GenericConfirmationModal
216+
bodyText={
217+
<span>
218+
Are you sure you want to delete your account?
219+
220+
<strong>
221+
This action cannot be undone.
222+
</strong>
223+
You will be unable to access any tracked characters or threads in the future, unless you create a new account and re-add them.
224+
</span>
225+
}
226+
closeButtonText="Cancel"
227+
data={null}
228+
headerText="Really Delete Account?"
229+
submitButtonText="Confirm Deletion"
230+
/>
215231
</div>
216232
`;
217233

@@ -427,5 +443,21 @@ exports[`rendering snapshots should render valid snapshot with missing character
427443
submitButtonText="Delete Tag"
428444
submitCallback={[MockFunction]}
429445
/>
446+
<GenericConfirmationModal
447+
bodyText={
448+
<span>
449+
Are you sure you want to delete your account?
450+
451+
<strong>
452+
This action cannot be undone.
453+
</strong>
454+
You will be unable to access any tracked characters or threads in the future, unless you create a new account and re-add them.
455+
</span>
456+
}
457+
closeButtonText="Cancel"
458+
data={null}
459+
headerText="Really Delete Account?"
460+
submitButtonText="Confirm Deletion"
461+
/>
430462
</div>
431463
`;

src/display/views/settings/Settings.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const Settings = (props) => {
3737
const onDeleteAccountClicked = (e) => {
3838
e.preventDefault();
3939
props.openDeleteAccountConfirmationModal();
40-
}
40+
};
4141
return (
4242
<div className="animated fadeIn static-container settings-container">
4343
<Row>

src/display/views/settings/__tests__/__snapshots__/Settings.spec.js.snap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ exports[`rendering snapshots should render valid snapshot 1`] = `
9999
}
100100
}
101101
/>
102+
<DeleteAccountPane
103+
onDeleteAccountClicked={[Function]}
104+
/>
102105
</Styled(TabContent)>
103106
</Col>
104107
</Row>

src/display/views/settings/components/DeleteAccountPane.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ const DeleteAccountPane = ({ onDeleteAccountClicked }) => {
2121
</Card>
2222
</TabPane>
2323
);
24-
}
24+
};
2525
DeleteAccountPane.propTypes = propTypes;
2626
export default DeleteAccountPane;

src/infrastructure/constants/__tests__/__snapshots__/tabs.spec.js.snap

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ Object {
2929
"href": "/settings/change-username",
3030
"name": "Change Username/Email",
3131
},
32+
"DELETE_ACCOUNT": Object {
33+
"href": "/settings/delete-account",
34+
"name": "Delete Account",
35+
},
3236
},
3337
"TOOLS": Object {
3438
"BROWSER_EXTENSIONS": Object {

src/infrastructure/reducers/__tests__/ui.spec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const getState = (overrides) => ({
1616
isUpsertPublicViewModalOpen: false,
1717
isDeletePublicViewModalOpen: false,
1818
isBulkUpdateTagModalOpen: false,
19+
isDeleteAccountConfirmationModalOpen: false,
1920
isBulkDeleteTagModalOpen: false,
2021
useLightTheme: false,
2122
...overrides

src/infrastructure/selectors/characters/__tests__/getCharactersSortedByIdentifer.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ describe('behavior', () => {
2222
const result = getCharactersSortedByIdentifier.resultFunc(characters);
2323
// Assert
2424
expect(result).toEqual([2, 3, 5, 7, 8, 9]);
25-
expect(utility.sortCharacters).toHaveBeenCalledTimes(8);
25+
expect(utility.sortCharacters).toHaveBeenCalled();
2626
});
2727
});

0 commit comments

Comments
 (0)