가입 트리거 서울 리전 · 탈퇴 시 업로드 파일 삭제 · 위치 인증 위경도 미저장

This commit is contained in:
Sn-Kinos
2026-10-06 18:29:51 +09:00
parent 14fef64999
commit e9e4260e2c
7 changed files with 41 additions and 12 deletions
@@ -1,6 +1,7 @@
import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest';
import { getAuth } from 'firebase-admin/auth';
import { getFirestore } from 'firebase-admin/firestore';
import { getStorage } from 'firebase-admin/storage';
import { bootAdmin, shutdownAdmin, wipeUser } from './support.js';
import { fnAccountWithdraw, fnAuthOnCreate, fnSignupConsent } from '../src/account/account.js';
@@ -103,6 +104,18 @@ describe('fnAccountWithdraw', () => {
expect((await db().doc(`users/${U}/popTransactions/t1`).get()).exists).toBe(true);
await expect(getAuth().getUser(U)).rejects.toBeDefined();
});
it.skipIf(!process.env.STORAGE_EMULATOR_HOST)('본인 전용 Storage 경로는 지우고 라운지 글 사진은 남긴다', async () => {
await getAuth().createUser({ uid: U });
const bucket = getStorage().bucket();
const paths = [`users/${U}/profile/photo`, `questProofs/${U}/q1/1.jpg`, `users/${U}/lounge/aaaaaaaaaaaaaaaaaaaa-0`, 'users/other/profile/photo'];
for (const p of paths) await bucket.file(p).save('x');
await fnAccountWithdraw.run(as(U, {}));
const exists = await Promise.all(paths.map(async (p) => (await bucket.file(p).exists())[0]));
expect(exists).toEqual([false, false, true, true]);
await bucket.file(paths[2]!).delete();
await bucket.file(paths[3]!).delete();
});
});
describe('카카오 이메일 · 탈퇴 후 재가입', () => {