test: dont try to load admin upload routes

isekai-main
Barış Soner Uşaklı 2 years ago
parent 07a0212571
commit c2bb2b30be

@ -832,7 +832,18 @@ describe('Admin Controllers', () => {
});
});
}
for (const route of Object.keys(privileges.admin.routeMap)) {
const uploadRoutes = [
'category/uploadpicture',
'uploadfavicon',
'uploadTouchIcon',
'uploadMaskableIcon',
'uploadlogo',
'uploadOgImage',
'uploadDefaultAvatar',
];
const adminRoutes = Object.keys(privileges.admin.routeMap)
.filter(route => !uploadRoutes.includes(route));
for (const route of adminRoutes) {
/* eslint-disable no-await-in-loop */
await privileges.admin.rescind([privileges.admin.routeMap[route]], uid);
let res = await makeRequest(`${nconf.get('url')}/api/admin/${route}`);
@ -845,7 +856,7 @@ describe('Admin Controllers', () => {
await privileges.admin.rescind([privileges.admin.routeMap[route]], uid);
}
for (const route of Object.keys(privileges.admin.routeMap)) {
for (const route of adminRoutes) {
/* eslint-disable no-await-in-loop */
await privileges.admin.rescind([privileges.admin.routeMap[route]], uid);
let res = await makeRequest(`${nconf.get('url')}/api/admin`);

Loading…
Cancel
Save