creative-assets: the dry run plans one upload per file, not per slot (a shared file used by 13 locales read as 26 uploads)
This commit is contained in:
parent
7e69883dfc
commit
98d3bf4410
3 changed files with 24 additions and 4 deletions
|
|
@ -194,6 +194,19 @@ describe('apple creative-assets against the fake App Store Connect', () => {
|
|||
expect((await go(p, ['--verify'])).out).toContain('every slot shows the local file');
|
||||
});
|
||||
|
||||
test('one shared file for many locales: the dry run plans one upload, the run uploads once and places it per locale', async () => {
|
||||
const two = { ...CFG, languages: [{ id: 'en', apple: 'en-US', play: 'en-US' }, { id: 'tr', apple: 'tr', play: 'tr-TR' }] };
|
||||
s.asc.put({ type: 'appAssetLibraries', id: 'lib-1', attributes: {}, rels: { app: APP } });
|
||||
s.asc.put({ type: 'appStoreVersions', id: 'ver-1', attributes: { versionString: '1.0.0', appVersionState: 'PREPARE_FOR_SUBMISSION', platform: 'IOS' }, rels: { app: APP } });
|
||||
for (const l of ['en-US', 'tr']) s.asc.put({ type: 'appStoreVersionLocalizations', id: `loc-${l}`, attributes: { locale: l }, rels: { appStoreVersion: 'ver-1' } });
|
||||
const p = project(two, { 'store/renders/creative/header.png': png(3840, 1646, false, 4) });
|
||||
const dry = await go(p, ['--dry']);
|
||||
expect(dry.out).toContain('1 file(s) to upload (used by 2 slots)');
|
||||
const r = await go(p);
|
||||
expect(r.w.filter(x => x === 'POST /v1/appAssetLibraryImages')).toHaveLength(1);
|
||||
expect(r.w.filter(x => x === 'POST /v1/appAssetLibraryPlacements')).toHaveLength(2);
|
||||
});
|
||||
|
||||
test('a bad file stops the run before any call', async () => {
|
||||
const p = setup({ 'store/renders/en/creative/header.png': png(3840, 1600, true) });
|
||||
const a = s.calls.length;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue