diff --git a/packages/app/components/profile/deleteAccount/DeleteAccount.story.tsx b/packages/app/components/profile/deleteAccount/DeleteAccount.story.tsx
index e5b6cb4..4c6f196 100644
--- a/packages/app/components/profile/deleteAccount/DeleteAccount.story.tsx
+++ b/packages/app/components/profile/deleteAccount/DeleteAccount.story.tsx
@@ -9,10 +9,8 @@ import DeleteAccount from './DeleteAccount';
storiesOf('Components/Profile', module).add('DeleteAccount', () => (
{
+ onSubmit={async () => {
action('onSubmit')();
-
- return Promise.resolve();
}}
/>
diff --git a/packages/app/pages/profile/DeleteAccountPage.tsx b/packages/app/pages/profile/DeleteAccountPage.tsx
index 48236d2..283e481 100644
--- a/packages/app/pages/profile/DeleteAccountPage.tsx
+++ b/packages/app/pages/profile/DeleteAccountPage.tsx
@@ -11,23 +11,18 @@ const DeleteAccountPage: ComponentType = () => {
const context = useContext(ProfileContext);
const dispatch = useReduxDispatch();
const { current: form } = useRef(new FormModel());
- const onSubmit = useCallback(
- () =>
- context
- .onSubmit({
- form,
- sendData: () => deleteAccount(context.userId, form.serialize()),
- })
- .then(() => {
- dispatch(
- updateUser({
- isDeleted: true,
- }),
- );
- context.goToProfile();
- }),
- [context],
- );
+ const onSubmit = useCallback(async () => {
+ await context.onSubmit({
+ form,
+ sendData: () => deleteAccount(context.userId, form.serialize()),
+ });
+ dispatch(
+ updateUser({
+ isDeleted: true,
+ }),
+ );
+ context.goToProfile();
+ }, [context]);
return ;
};
diff --git a/tests-e2e/cypress/integration/auth/oauth.test.ts b/tests-e2e/cypress/integration/auth/oauth.test.ts
index f4d3965..753d852 100644
--- a/tests-e2e/cypress/integration/auth/oauth.test.ts
+++ b/tests-e2e/cypress/integration/auth/oauth.test.ts
@@ -125,7 +125,7 @@ describe('OAuth', () => {
it('should allow sign in during oauth (guest oauth)', () => {
cy.visit(`/oauth2/v1/ely?${new URLSearchParams(defaults)}`);
- cy.url().should('include', '/login');
+ cy.location('pathname').should('eq', '/login');
cy.get('[name=login]').type(`${account1.login}{enter}`);
@@ -139,7 +139,7 @@ describe('OAuth', () => {
it('should allow sign in during oauth and not finish process if the account is deleted', () => {
cy.visit(`/oauth2/v1/ely?${new URLSearchParams(defaults)}`);
- cy.url().should('include', '/login');
+ cy.location('pathname').should('eq', '/login');
cy.get('[name=login]').type(`${account1.login}{enter}`);
@@ -296,7 +296,7 @@ describe('OAuth', () => {
cy.findByTestId('auth-controls').contains('another account').click();
- cy.url().should('include', '/login');
+ cy.location('pathname').should('eq', '/login');
cy.get('[name=login]').type(`${account1.login}{enter}`);
@@ -381,7 +381,7 @@ describe('OAuth', () => {
})}`,
);
- cy.url().should('include', '/login');
+ cy.location('pathname').should('eq', '/login');
cy.get('[name=login]').type(`${account1.login}{enter}`);
diff --git a/tests-e2e/cypress/integration/auth/sign-in.test.ts b/tests-e2e/cypress/integration/auth/sign-in.test.ts
index f3280b2..0425584 100644
--- a/tests-e2e/cypress/integration/auth/sign-in.test.ts
+++ b/tests-e2e/cypress/integration/auth/sign-in.test.ts
@@ -214,7 +214,7 @@ describe('Sign in / Log out', () => {
cy.location('pathname').should('eq', '/accept-rules');
- cy.findByTestId('auth-controls-secondary').contains('Decline and logout').click();
+ cy.findByText('Decline and logout').click();
cy.location('pathname').should('eq', '/login');
cy.findByTestId('toolbar').should('contain', 'Join');
@@ -255,7 +255,7 @@ describe('Sign in / Log out', () => {
cy.location('pathname').should('eq', '/accept-rules');
- cy.findByTestId('auth-controls-secondary').contains('Delete account').click();
+ cy.findByText('Delete account').click();
cy.location('pathname').should('eq', '/profile/delete');