testflight distribute: groups of apple.testflight.groups missing on App Store Connect are created first (only the asked-for ones, never removed; dry run shows it); tests, skill, CHANGELOG
This commit is contained in:
parent
163e666834
commit
aceb994cae
4 changed files with 60 additions and 20 deletions
|
|
@ -134,11 +134,26 @@ describe('apple testflight distribute (real use 2026-10-13)', () => {
|
|||
expect(out.out).toContain('already in Devs (internal)');
|
||||
});
|
||||
|
||||
test('a group in the config but not on App Store Connect points at groups sync; an unknown one lists what exists', async () => {
|
||||
test('a group in the config but not on App Store Connect is created first (groups sync), then gets the build; the re-run writes nothing', async () => {
|
||||
const p = project(TF);
|
||||
s.asc.put({ type: 'builds', id: 'b-1', attributes: { version: '1', processingState: 'VALID', usesNonExemptEncryption: false, expired: false }, rels: { app: APP } });
|
||||
s.asc.put({ type: 'betaGroups', id: 'grp-devs', attributes: { name: 'Devs', isInternalGroup: true, hasAccessToAllBuilds: false }, rels: { app: APP } });
|
||||
const dry = await capture(() => appleTestflight(p.ctx(['distribute', '--build', '1', '--group', 'Friends', '--dry'])));
|
||||
expect(dry.out).toContain('would create beta group(s) from apple.testflight.groups first: "Friends"');
|
||||
expect(count('betaGroups')).toBe(1);
|
||||
const r = await twice(() => appleTestflight(p.ctx(['distribute', '--build', '1', '--group', 'Friends,Devs', '--yes'])));
|
||||
expect(r.first[0]).toBe('POST /v1/betaGroups');
|
||||
expect(r.first.filter(w => w === 'POST /v1/betaGroups')).toHaveLength(1);
|
||||
expect(r.first.filter(w => /relationships\/builds$/.test(w))).toHaveLength(2);
|
||||
expect(r.second).toEqual([]);
|
||||
// only the missing one of --group was created; Team (configured, not asked for) was not; nothing removed
|
||||
expect(s.asc.all('betaGroups').map(g => g.attributes.name).sort()).toEqual(['Devs', 'Friends']);
|
||||
expect(s.calls.some(c => c.method === 'DELETE')).toBe(false);
|
||||
});
|
||||
|
||||
test('an unknown group (not in the config) still lists what exists', async () => {
|
||||
const p = project(TF);
|
||||
s.asc.put({ type: 'builds', id: 'b-1', attributes: { version: '1', processingState: 'VALID' }, rels: { app: APP } });
|
||||
await expect(capture(() => appleTestflight(p.ctx(['distribute', '--build', '1', '--group', 'Team', '--yes']))))
|
||||
.rejects.toThrow('group "Team" is in the config but not on App Store Connect yet: create it with `storebound apple testflight groups sync`');
|
||||
s.asc.put({ type: 'betaGroups', id: 'grp-friends', attributes: { name: 'Friends', isInternalGroup: false }, rels: { app: APP } });
|
||||
await expect(capture(() => appleTestflight(p.ctx(['distribute', '--build', '1', '--group', 'Nope', '--yes']))))
|
||||
.rejects.toThrow('unknown group "Nope": App Store Connect has "Friends"');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue