Cover delete/restore account forms with E2E tests

This commit is contained in:
ErickSkrauch
2020-07-28 23:00:51 +03:00
parent 8ee2323bfa
commit 3cff6ad26c
7 changed files with 159 additions and 13 deletions

View File

@@ -22,7 +22,7 @@ const AccountDeleted: ComponentType<Props> = ({ onRestore }) => {
}, [onRestore]);
return (
<div className={styles.wrapper}>
<div className={styles.wrapper} data-testid="deletedAccount">
<Message key="accountDeleted" defaultMessage="Account is deleted">
{(pageTitle: string) => (
<h2 className={styles.title}>

View File

@@ -193,8 +193,14 @@ const Profile: ComponentType<Props> = ({ user, activeLocale }) => {
<ProfileField
value={
// @ts-ignore
<Button component={Link} to="/profile/delete" small color="black">
<Button
component={Link}
// @ts-ignore
to="/profile/delete"
small
color="black"
data-testid="profile-action"
>
<Message key="accountDeletion" defaultMessage="Account deletion" />
</Button>
}

View File

@@ -7,6 +7,7 @@ export interface UserResponse {
id: number;
isActive: boolean;
isOtpEnabled: boolean;
isDeleted: boolean;
lang: string;
passwordChangedAt: number; // timestamp
registeredAt: number; // timestamp
@@ -16,13 +17,7 @@ export interface UserResponse {
}
export function getInfo(id: number, token?: string): Promise<UserResponse> {
return request.get(
`/api/v1/accounts/${id}`,
{},
{
token,
},
);
return request.get(`/api/v1/accounts/${id}`, {}, { token });
}
export function changePassword(