mirror of
https://github.com/PR0M3TH3AN/TORCH.git
synced 2026-11-10 23:00:34 +00:00
test(integration): cover exact adoption recovery
TASK-f40126ee-2485-45c8-a67b-4279e4e8704a
This commit is contained in:
1 parent
8ea3bef13e
commit
63dd032b7f
3 files changed
+242
-1
No files matched your search
@@ -82,7 +82,8 @@ function exactAuthority(authority, binding) {
|
||||
function exactInput(record, input) {
|
||||
const fields = ['adoptionId', 'candidateSha', 'baseTargetSha', 'provenanceManifestDigest',
|
||||
'contributorArea', 'destinationArea', 'targetBranch', 'candidateRef', 'expectedOldRef'];
|
||||
const mismatches = fields.filter((field) => input[field] !== undefined && input[field] !== record[field]);
|
||||
const mismatches = fields.filter((field) => input[field] !== undefined
|
||||
&& input[field] !== (field === 'adoptionId' ? record.id : record[field]));
|
||||
if (input.provenance !== undefined && JSON.stringify(input.provenance) !== JSON.stringify(record.provenance)) mismatches.push('provenance');
|
||||
if (mismatches.length) throw new TorchError('Lifecycle input cannot override immutable prepared adoption fields', {
|
||||
code: 'ADOPTION_IMMUTABLE_BINDING_STALE', details: { adoptionId: record.id, fields: mismatches },
|
||||
|
||||
Reference in new issue
Block a user