feat(profile): account-deletion flow + terminal deleted screen
Profile gains a Delete-account control (durable accounts) opening a step-up dialog: a
mailed code for an email account, or the typed DELETE phrase for a platform-only one.
On success the app swaps to a terminal AccountDeleted screen ('Учётная запись удалена')
with a Close that closes the host Mini App (telegramClose / vkClose; web = no close).
Wires deleteRequest/deleteConfirm through client/transport/mock/codec; ru/en i18n;
codec wire test + Chromium/WebKit e2e.
This commit is contained in:
@@ -27,6 +27,8 @@ import {
|
||||
encodeEnqueue,
|
||||
encodeExchange,
|
||||
encodeExportUrlRequest,
|
||||
encodeAccountDeleteConfirm,
|
||||
decodeDeleteRequestResult,
|
||||
encodeGuestLogin,
|
||||
encodeLinkUnlink,
|
||||
encodeStateRequest,
|
||||
@@ -464,6 +466,21 @@ describe('codec', () => {
|
||||
expect(r.kind()).toBe('telegram');
|
||||
});
|
||||
|
||||
it('round-trips the account-delete confirm + request-result wire', () => {
|
||||
const c = fb.AccountDeleteConfirm.getRootAsAccountDeleteConfirm(
|
||||
new ByteBuffer(encodeAccountDeleteConfirm('123456', 'DELETE')),
|
||||
);
|
||||
expect(c.code()).toBe('123456');
|
||||
expect(c.phrase()).toBe('DELETE');
|
||||
|
||||
const b = new Builder(32);
|
||||
const m = b.createString('email');
|
||||
fb.AccountDeleteRequestResult.startAccountDeleteRequestResult(b);
|
||||
fb.AccountDeleteRequestResult.addMethod(b, m);
|
||||
b.finish(fb.AccountDeleteRequestResult.endAccountDeleteRequestResult(b));
|
||||
expect(decodeDeleteRequestResult(b.asUint8Array()).method).toBe('email');
|
||||
});
|
||||
|
||||
it('passes an unlinked / changed LinkResult status straight through', () => {
|
||||
for (const status of ['unlinked', 'changed'] as const) {
|
||||
const b = new Builder(64);
|
||||
|
||||
Reference in New Issue
Block a user