apple iap-review: size check before upload, delivery state read back after (FAILED shown with Apple's reason), dry run names why it would upload, MISSING_METADATA explained per part; check flags non-screenshot sizes offline

This commit is contained in:
CRTkafa 2026-10-11 19:24:41 +00:00
parent e331a316d7
commit fb7a9e928a
3 changed files with 92 additions and 13 deletions

View file

@ -457,3 +457,14 @@ describe('config + scrub', () => {
expect(hits.map(h => h.rule).sort()).toEqual(['apple-id-like', 'email', 'ip-address', 'private-key']);
});
});
describe('iap review screenshot size', () => {
const png = (w: number, h: number) => { const b = Buffer.alloc(33); b.set([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a], 0); b.writeUInt32BE(13, 8); b.write('IHDR', 12); b.writeUInt32BE(w, 16); b.writeUInt32BE(h, 20); b[24] = 8; b[25] = 2; return b; };
test('only App Store screenshot sizes pass (1320 x 2706 was rejected by Apple with IMAGE_INCORRECT_DIMENSIONS)', async () => {
const { reviewShotProblem } = await import('../cli/apple/iap-review');
expect(reviewShotProblem(png(1320, 2706))).toContain('IMAGE_INCORRECT_DIMENSIONS');
expect(reviewShotProblem(png(1320, 2868))).toBeNull();
expect(reviewShotProblem(png(2796, 1290))).toBeNull(); // landscape
expect(reviewShotProblem(png(2064, 2752))).toBeNull(); // iPad 13"
});
});