Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more tests for instructor permissions to fetch ddahs #599

Merged
merged 17 commits into from
Jun 20, 2021
Prev Previous commit
Lint setup please.
alex-kozin committed Jun 20, 2021
commit c88d27288379650bd9714e985044e80cde3f4835
7 changes: 3 additions & 4 deletions frontend/src/tests/setup.js
Original file line number Diff line number Diff line change
@@ -531,8 +531,7 @@ async function seedDatabaseForInstructors(
// at most one position
const { id: assignment_id } =
processedAssignments.find(
(assignment) =>
assignment._temp_id === ddah._temp_id
(assignment) => assignment._temp_id === ddah._temp_id
) || {};
if (!assignment_id) {
throw new Error(
@@ -551,13 +550,13 @@ async function seedDatabaseForInstructors(
// Cleanup
for (const assignment of seeded.assignments) {
if (assignment._temp_id) {
const {temp_id, ...cleanAssignment } = assignment;
const { temp_id, ...cleanAssignment } = assignment;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alex-kozin Fix this - delete all properties with an underscore

Object.assign(assignment, cleanAssignment);
}
}

for (const ddah of seeded.ddahs) {
const {temp_id, ...cleanDdah } = ddah;
const { temp_id, ...cleanDdah } = ddah;
Object.assign(ddah, cleanDdah);
}
}