걸음 수 Health Connect·HealthKit · 위치 퀘스트 사진·QR 인증 · 행성 형태 확정
This commit is contained in:
@@ -264,6 +264,17 @@ describe('성장 귀속 행 — users/{uid}/growthEvents (HOME 주간 정보 A-3
|
||||
});
|
||||
});
|
||||
|
||||
describe('위치 Quest QR 코드 — questSecrets/{questId} (C-03)', () => {
|
||||
test('생성자만 읽고 참여자는 읽지 못하며 누구도 쓰지 못한다', async () => {
|
||||
await seedDocuments(testEnvironment, {
|
||||
'questSecrets/quest-1': { authorUid: 'alice', qrCode: 'secret' },
|
||||
});
|
||||
await assertSucceeds(getDoc(doc(dbFor('alice'), 'questSecrets/quest-1')));
|
||||
await assertFails(getDoc(doc(dbFor('bob'), 'questSecrets/quest-1')));
|
||||
await assertFails(setDoc(doc(dbFor('alice'), 'questSecrets/quest-2'), { authorUid: 'alice', qrCode: 'x' }));
|
||||
});
|
||||
});
|
||||
|
||||
describe('가입 목록 — users/{uid}/memberships (C-15)', () => {
|
||||
beforeEach(async () => {
|
||||
await seedDocuments(testEnvironment, {
|
||||
|
||||
@@ -93,6 +93,18 @@ describe('프로필 사진 — users/{uid}/profile', () => {
|
||||
await assertSucceeds(deleteObject(ref(storageFor('alice'), path)));
|
||||
});
|
||||
|
||||
test('방문 인증 사진은 본인 경로에 10MB 이하 이미지 한 번만, 지우지 못한다 (C-03)', async () => {
|
||||
const path = 'questProofs/alice/quest-1/1.jpg';
|
||||
const jpeg = { contentType: 'image/jpeg' };
|
||||
await assertSucceeds(uploadBytes(ref(storageFor('alice'), path), bytesOf(1024), jpeg));
|
||||
await assertFails(uploadBytes(ref(storageFor('alice'), path), bytesOf(1024), jpeg));
|
||||
await assertFails(uploadBytes(ref(storageFor('bob'), 'questProofs/alice/quest-1/2.jpg'), bytesOf(1024), jpeg));
|
||||
await assertFails(
|
||||
uploadBytes(ref(storageFor('alice'), 'questProofs/alice/quest-1/3.jpg'), bytesOf(10 * 1024 * 1024 + 1), jpeg),
|
||||
);
|
||||
await assertFails(deleteObject(ref(storageFor('alice'), path)));
|
||||
});
|
||||
|
||||
test('열지 않은 경로는 기본 거부다', async () => {
|
||||
await assertFails(
|
||||
uploadBytes(ref(storageFor('alice'), 'posts/post-1/media/1.png'), bytesOf(1024), image),
|
||||
|
||||
Reference in New Issue
Block a user