"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const projectMemberRole_1 = require("../../types/projectMemberRole");
const projectMemberRole_2 = require("../../utils/projectMemberRole");
const roleToScopeMapping_1 = require("../roleToScopeMapping");
const customRoleProjectRole_1 = require("./customRoleProjectRole");
describe('getProjectRoleForSpaceAccess', () => {
    it.each(Object.values(projectMemberRole_1.ProjectMemberRole))('derives the same inherited space role as the system role %s it was duplicated from', (role) => {
        const derivedRole = (0, customRoleProjectRole_1.getProjectRoleForSpaceAccess)([
            ...roleToScopeMapping_1.PROJECT_ROLE_TO_SCOPES_MAP[role],
        ]);
        expect((0, projectMemberRole_2.convertProjectRoleToSpaceRole)(derivedRole)).toEqual((0, projectMemberRole_2.convertProjectRoleToSpaceRole)(role));
    });
});
describe('getOrganizationRoleForSpaceAccess', () => {
    it.each(Object.values(projectMemberRole_1.ProjectMemberRole))('org derivation converts to the same project role as the direct derivation for %s scopes', (role) => {
        const scopes = [...roleToScopeMapping_1.PROJECT_ROLE_TO_SCOPES_MAP[role]];
        expect((0, projectMemberRole_2.convertOrganizationRoleToProjectRole)((0, customRoleProjectRole_1.getOrganizationRoleForSpaceAccess)(scopes))).toEqual((0, customRoleProjectRole_1.getProjectRoleForSpaceAccess)(scopes));
    });
});
//# sourceMappingURL=customRoleProjectRole.test.js.map