test(platform-service): update fleet artifact tests for productId-scoped listing

listArtifactsByJob now requires productId; thread it through the existing
repository/artifacts test callers (signature update, assertions unchanged).
This commit is contained in:
saravanakumardb1 2026-05-30 00:06:10 -07:00
parent e06b730161
commit 32328247ad
2 changed files with 4 additions and 4 deletions

View File

@ -124,8 +124,8 @@ describe('fleet artifacts — blob service', () => {
contentType: 'image/png', contentType: 'image/png',
}); });
const a = await repo.listArtifactsByJob('jA'); const a = await repo.listArtifactsByJob('jA', PID);
const b = await repo.listArtifactsByJob('jB'); const b = await repo.listArtifactsByJob('jB', PID);
expect(a).toHaveLength(2); expect(a).toHaveLength(2);
expect(a.every(x => x.jobId === 'jA')).toBe(true); expect(a.every(x => x.jobId === 'jA')).toBe(true);
expect(b).toHaveLength(1); expect(b).toHaveLength(1);

View File

@ -182,7 +182,7 @@ describe('fleet repository', () => {
sizeBytes: 42, sizeBytes: 42,
createdAt: now, createdAt: now,
}); });
const arts = await repo.listArtifactsByJob('j'); const arts = await repo.listArtifactsByJob('j', PID);
expect(arts).toHaveLength(1); expect(arts).toHaveLength(1);
expect(arts[0].blobKey).toBe('fleet/lysnrai/j/art_1-coverage'); expect(arts[0].blobKey).toBe('fleet/lysnrai/j/art_1-coverage');
@ -193,7 +193,7 @@ describe('fleet repository', () => {
// delete returns the removed doc and clears the partition // delete returns the removed doc and clears the partition
const removed = await repo.deleteArtifact('art_1', PID); const removed = await repo.deleteArtifact('art_1', PID);
expect(removed?.id).toBe('art_1'); expect(removed?.id).toBe('art_1');
expect(await repo.listArtifactsByJob('j')).toHaveLength(0); expect(await repo.listArtifactsByJob('j', PID)).toHaveLength(0);
expect(await repo.deleteArtifact('art_1', PID)).toBeNull(); expect(await repo.deleteArtifact('art_1', PID)).toBeNull();
}); });
}); });