mirror of
https://github.com/elyby/accounts-frontend.git
synced 2025-05-31 14:11:58 +05:30
Cover delete/restore account forms with E2E tests
This commit is contained in:
@@ -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}>
|
||||
|
@@ -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>
|
||||
}
|
||||
|
@@ -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(
|
||||
|
Reference in New Issue
Block a user