重构修改2925获取邮箱
This commit is contained in:
@@ -51,6 +51,8 @@ function extractFunction(name) {
|
||||
}
|
||||
|
||||
const bundle = [
|
||||
extractFunction('getPageTextSnapshot'),
|
||||
extractFunction('getLoginVerificationDisplayedEmail'),
|
||||
extractFunction('inspectLoginAuthState'),
|
||||
extractFunction('normalizeStep6Snapshot'),
|
||||
].join('\n');
|
||||
@@ -62,6 +64,13 @@ const location = {
|
||||
pathname: ${JSON.stringify(overrides.pathname || '/log-in')},
|
||||
};
|
||||
|
||||
const document = {
|
||||
body: {
|
||||
innerText: ${JSON.stringify(overrides.pageText || '')},
|
||||
textContent: ${JSON.stringify(overrides.pageText || '')},
|
||||
},
|
||||
};
|
||||
|
||||
function getLoginTimeoutErrorPageState() {
|
||||
return ${JSON.stringify(overrides.retryState || null)};
|
||||
}
|
||||
@@ -127,6 +136,16 @@ return {
|
||||
);
|
||||
}
|
||||
|
||||
{
|
||||
const api = createApi({
|
||||
verificationTarget: { id: 'otp' },
|
||||
pageText: 'We emailed a code to display.user@example.com. Enter it below.',
|
||||
});
|
||||
|
||||
const snapshot = api.inspectLoginAuthState();
|
||||
assert.strictEqual(snapshot.displayedEmail, 'display.user@example.com');
|
||||
}
|
||||
|
||||
{
|
||||
const api = createApi({
|
||||
oauthConsentPage: true,
|
||||
|
||||
Reference in New Issue
Block a user