소셜 로그인 인증 경로 · 세션 전이 · Apple 로그인 콜백 · 인증 테스트

This commit is contained in:
Sn-Kinos
2026-08-18 02:06:29 +09:00
parent 97ea5fad35
commit 357f5d759d
20 changed files with 729 additions and 127 deletions
@@ -111,6 +111,58 @@ describe('원칙 1 — POP·FPI·원장은 클라이언트 쓰기 불가', () =>
});
});
describe('단결형 아이템 접근 경계', () => {
beforeEach(async () => {
await seedDocuments(testEnvironment, {
'fandoms/fandom-a/solidarityBoosts/boost-1': {
triggerUid: 'alice',
multiplier: 2,
startsAt: '2026-08-14T00:00:00Z',
endsAt: '2026-08-14T01:00:00Z',
scope: 'fandom',
status: 'active',
},
});
});
test('로그인 사용자는 단결형 활성 상태를 읽을 수 있다', async () => {
await assertSucceeds(
getDoc(doc(dbFor('alice'), 'fandoms/fandom-a/solidarityBoosts/boost-1')),
);
});
test('미인증 사용자는 단결형 활성 상태를 읽을 수 없다', async () => {
await assertFails(
getDoc(doc(anonymousDb(), 'fandoms/fandom-a/solidarityBoosts/boost-1')),
);
});
test('일반 사용자는 단결형 상태를 생성할 수 없다', async () => {
await assertFails(
setDoc(doc(dbFor('alice'), 'fandoms/fandom-a/solidarityBoosts/forged'), {
triggerUid: 'alice',
multiplier: 999,
status: 'active',
}),
);
});
test('master도 단결형 상태를 수정할 수 없다', async () => {
await assertFails(
updateDoc(
doc(dbFor('master-user', { role: 'master' }), 'fandoms/fandom-a/solidarityBoosts/boost-1'),
{ multiplier: 999 },
),
);
});
test('일반 사용자는 단결형 상태를 삭제할 수 없다', async () => {
await assertFails(
deleteDoc(doc(dbFor('alice'), 'fandoms/fandom-a/solidarityBoosts/boost-1')),
);
});
});
describe('원칙 2 — 개인 리소스와 쓰기 필드 제한', () => {
beforeEach(async () => {
await seedDocuments(testEnvironment, {