You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
describe("ADML attributes position to a user in another structure",()=>{
145
-
checkReturnCode(attributePositions(teacher1,[position2],session),`ADML should not be able to attribute a position from another structure to a teacher`,401);
146
-
checkReturnCode(attributePositions(relative1,[position2],session),`ADML should not be able to attribute a position from another structure to a relative`,401);
147
-
checkReturnCode(attributePositions(student1,[position2],session),`ADML should not be able to attribute a position from another structure to a student`,401);
describe("ADMC attributes position to a user in another structure",()=>{
161
-
//////////////////////////////
162
-
// Try to attribute position
163
-
// from another structure
164
-
checkReturnCode(attributePositions(teacher1,[position2],session),`ADMC should not be able to attribute a position from another structure to a teacher`,401);
165
-
checkReturnCode(attributePositions(relative1,[position2],session),`ADMC should not be able to attribute a position from another structure to a relative`,401);
166
-
checkReturnCode(attributePositions(student1,[position2],session),`ADMC should not be able to attribute a position from another structure to a student`,401);
console.error(`${requesterType} should have been able to attribute all positions to a ${userType}, ${missingPositions.length}/${positions.length} where not added : ${missingPositions}`)
checkReturnCode(attributePositions(user,positions,session),`${requesterType} call to attribute a position to a ${userType} should end with ${returnCode}`,returnCode);
console.error(`${requesterType} should not be able to attribute a position to a ${userType}, expecting `,oldUserPositions,` but got `,newUserPositions,` when adding `,positions)
assertCondition(()=>res.status===201,"An ADML user should be able to create a position");
143
142
positions.push(JSON.parse(res.body));
144
-
145
-
assertSearchCriteriaOnlyContainThesePositions(positions,"ADML with a structure with these positions",session);
146
-
143
+
//assertSearchCriteriaContainSpecifiedPositionsAndNotOther(positions, p => p.structureId !== structure.id, "ADML with a structure with these positions", session);
assertSearchCriteriaOnlyContainThesePositions(positions,"ADML of multiple structures",session);
167
+
assertSearchCriteriaContainSpecifiedPositionsAndNotOther(positions,p=>p.structureId===structure1.id||p.structureId===structure2.id,"ADML of multiple structures",session);
170
168
})
171
169
};
172
170
/**
@@ -347,14 +345,18 @@ function noDuplicates(positions) {
0 commit comments