Some checks are pending
Automatisch Backend Tests / test (push) Waiting to run
Automatisch CI / linter (push) Waiting to run
Automatisch CI / start-backend-server (push) Waiting to run
Automatisch CI / start-backend-worker (push) Waiting to run
Automatisch CI / build-web (push) Waiting to run
Automatisch UI Tests / test (push) Waiting to run
16 lines
606 B
JavaScript
16 lines
606 B
JavaScript
import { faker } from '@faker-js/faker';
|
|
import { createRole } from './role.js';
|
|
import RoleMapping from '../../src/models/role-mapping.ee.js';
|
|
import { createSamlAuthProvider } from './saml-auth-provider.ee.js';
|
|
|
|
export const createRoleMapping = async (params = {}) => {
|
|
params.roleId = params.roleId || (await createRole()).id;
|
|
params.samlAuthProviderId =
|
|
params.samlAuthProviderId || (await createSamlAuthProvider()).id;
|
|
params.remoteRoleName = params.remoteRoleName || faker.person.jobType();
|
|
|
|
const roleMapping = await RoleMapping.query().insertAndFetch(params);
|
|
|
|
return roleMapping;
|
|
};
|