mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix(emails): broken test due to sticky registration interstitial
This commit is contained in:
@@ -13,15 +13,15 @@ get:
|
||||
"200":
|
||||
description: ""
|
||||
content:
|
||||
application/json:
|
||||
text/plain:
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: ../../../../components/schemas/UserObject.yaml#/UserObjectFull
|
||||
- type: object
|
||||
properties:
|
||||
hasPassword:
|
||||
type: boolean
|
||||
title:
|
||||
type: string
|
||||
- $ref: ../../../../components/schemas/Breadcrumbs.yaml#/Breadcrumbs
|
||||
- $ref: ../../../../components/schemas/CommonProps.yaml#/CommonProps
|
||||
description: A relative path to the registration interstitial page so they can add or update an email for their account
|
||||
example: /register/complete
|
||||
"302":
|
||||
description: Redirects the user to a registration interstitial page so they can add or update an email for their account
|
||||
headers:
|
||||
Location:
|
||||
schema:
|
||||
type: string
|
||||
example: /register/complete
|
||||
12
test/api.js
12
test/api.js
@@ -466,6 +466,18 @@ describe('API', async () => {
|
||||
csrfToken = config.csrf_token;
|
||||
}
|
||||
});
|
||||
|
||||
it('should back out of a registration interstitial if needed', async () => {
|
||||
const affectedPaths = ['GET /api/user/{userslug}/edit/email'];
|
||||
if (affectedPaths.includes(`${method.toUpperCase()} ${path}`)) {
|
||||
await request({
|
||||
uri: `${nconf.get('url')}/register/abort`,
|
||||
method: 'POST',
|
||||
jar,
|
||||
simple: false,
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user