You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
1.2 KiB
JavaScript
18 lines
1.2 KiB
JavaScript
|
1 month ago
|
const assert = require("assert");
|
||
|
|
const fs = require("fs");
|
||
|
|
const path = require("path");
|
||
|
|
|
||
|
|
const root = path.resolve(__dirname, "..");
|
||
|
|
const api = fs.readFileSync(path.join(root, "src/api/schoolProductConfig.js"), "utf8");
|
||
|
|
const router = fs.readFileSync(path.join(root, "src/router/index.js"), "utf8");
|
||
|
|
const sidebar = fs.readFileSync(path.join(root, "src/layout/components/Sidebar/index.vue"), "utf8");
|
||
|
|
const platformSchool = fs.readFileSync(path.join(root, "src/views/platformAdmin/school/index.vue"), "utf8");
|
||
|
|
|
||
|
|
assert(/\/api\/school-product-config\/current/.test(api), "school users must load their product configuration");
|
||
|
|
assert(/\/product-config`/.test(api), "platform admins must update a school's product configuration");
|
||
|
|
assert(/requiresAdminClass:\s*true/.test(router), "administrative organization routes must be marked for configuration gating");
|
||
|
|
assert(/filterRoutesByOrganizationMode/.test(sidebar), "sidebar must remove unavailable administrative organization routes");
|
||
|
|
assert(/organizationMode/.test(platformSchool) && /updatePlatformSchoolProductConfig/.test(platformSchool), "platform school editor must manage organization mode");
|
||
|
|
|
||
|
|
console.log("School product configuration is represented in the API, routes, sidebar, and platform editor.");
|