Game Center switch before submit: apple submit / resubmit and signing ensure create gameCenterDetails and gameCenterAppVersions when Game Center is in use (config, entitlements or the built IPA), shown in the dry run; validate blocks on either missing; fake 409 BUILD_INDICATES_GAME_CENTER_ENABLED until both exist; pitfall 89
This commit is contained in:
parent
dd9e059036
commit
163e666834
9 changed files with 152 additions and 26 deletions
|
|
@ -11,6 +11,7 @@ import { verifyText } from '../cli/lib/console-verify';
|
|||
import { gameServicesFindings, type GameServicesStatus } from '../cli/games-status';
|
||||
import { run as gameCenter } from '../cli/apple/game-center';
|
||||
import { run as playGames } from '../cli/play/games';
|
||||
import { run as appleSubmit } from '../cli/apple/submit';
|
||||
import { upsertTiming } from '../cli/lib/upsert';
|
||||
import { ascEnv, BASE, capture, playEnv, project, restore } from './helpers/store-mock';
|
||||
import { installStores, type Stores, uninstallStores, writes } from './helpers/fake-stores';
|
||||
|
|
@ -202,9 +203,47 @@ describe('validate findings', () => {
|
|||
findings: [{ store: 'apple', level: 'error', id: 'gc.entitlement', msg: 'no entitlement' }], links: [],
|
||||
};
|
||||
const f = gameServicesFindings(st);
|
||||
expect(f.filter(x => x.level === 'blocker').map(x => x.code)).toEqual(['gc.entitlement', 'game-center.capability', 'game-center.detail']);
|
||||
expect(f.filter(x => x.level === 'blocker').map(x => x.code)).toEqual(['gc.entitlement', 'game-center.capability', 'game-center.detail', 'game-center.version']);
|
||||
expect(f.find(x => x.code === 'game-center.detail')!.msg).toContain('BUILD_INDICATES_GAME_CENTER_ENABLED');
|
||||
expect(f.map(x => x.code)).toContain('game-center.sync');
|
||||
expect(f.find(x => x.code === 'play-games')!.level).toBe('ok');
|
||||
expect(f.find(x => x.code === 'play-games.achievements')!.level).toBe('warn');
|
||||
});
|
||||
});
|
||||
|
||||
describe('apple submit with a Game Center build (live 409 STATE_ERROR.BUILD_INDICATES_GAME_CENTER_ENABLED)', () => {
|
||||
const fresh = () => {
|
||||
s.asc.gameCenterBuild = true;
|
||||
s.asc.put({ type: 'appStoreVersions', id: 'ver-1', attributes: { versionString: '1.0.0', appVersionState: 'PREPARE_FOR_SUBMISSION', platform: 'IOS' }, rels: { app: APP } });
|
||||
s.asc.put({ type: 'builds', id: 'b-8', attributes: { version: '8', processingState: 'VALID', usesNonExemptEncryption: false }, rels: { app: APP } });
|
||||
};
|
||||
test('the fake refuses the submit like App Store Connect while the switch is missing', async () => {
|
||||
fresh();
|
||||
const r = await capture(() => appleSubmit(project(BASE).ctx(['--build', '8', '--yes'])).catch(e => { console.error(String(e)); }));
|
||||
expect(r.err + r.out).toContain('BUILD_INDICATES_GAME_CENTER_ENABLED');
|
||||
expect(s.asc.all('reviewSubmissions').map(x => x.attributes.state)).not.toContain('WAITING_FOR_REVIEW');
|
||||
});
|
||||
test('dry run names the switch; --yes creates gameCenterDetails and gameCenterAppVersions before the submit, then passes', async () => {
|
||||
fresh();
|
||||
const p = project(GAME);
|
||||
const dry = await run2(() => appleSubmit(p.ctx(['--build', '8'])));
|
||||
expect(dry.writes).toEqual([]);
|
||||
expect(dry.out).toContain('would POST /v1/gameCenterDetails');
|
||||
expect(dry.out).toContain('would POST /v1/gameCenterAppVersions');
|
||||
const r = await run2(() => appleSubmit(p.ctx(['--build', '8', '--yes'])));
|
||||
const i = r.writes.indexOf('POST /v1/gameCenterDetails'), j = r.writes.indexOf('POST /v1/gameCenterAppVersions'), k = r.writes.findIndex(w => /^PATCH \/v1\/reviewSubmissions\//.test(w));
|
||||
expect(i).toBeGreaterThanOrEqual(0);
|
||||
expect(j).toBeGreaterThan(i);
|
||||
expect(k).toBeGreaterThan(j);
|
||||
expect(s.asc.all('reviewSubmissions').map(x => x.attributes.state)).toEqual(['WAITING_FOR_REVIEW']);
|
||||
expect(s.asc.all('gameCenterDetails')).toHaveLength(1);
|
||||
});
|
||||
test('apple game-center first, then submit: no second switch', async () => {
|
||||
fresh();
|
||||
const p = project(GAME);
|
||||
await run2(() => gameCenter(p.ctx(['--yes'])));
|
||||
const r = await run2(() => appleSubmit(p.ctx(['--build', '8', '--yes'])));
|
||||
expect(r.writes.filter(w => /gameCenter(Details|AppVersions)$/.test(w))).toEqual([]);
|
||||
expect(s.asc.all('gameCenterAppVersions')).toHaveLength(1);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue