Fixes based on test case.
This commit is contained in:
parent
26ee50b10b
commit
a56a228042
|
@ -516,7 +516,7 @@ export function getDBRoleID(roleName: string) {
|
||||||
export function getExternalRoleID(roleId: string, version?: string) {
|
export function getExternalRoleID(roleId: string, version?: string) {
|
||||||
// for built-in roles we want to remove the DB role ID element (role_)
|
// for built-in roles we want to remove the DB role ID element (role_)
|
||||||
if (
|
if (
|
||||||
roleId.startsWith(DocumentType.ROLE) &&
|
roleId.startsWith(`${DocumentType.ROLE}${SEPARATOR}`) &&
|
||||||
(isBuiltin(roleId) || version === RoleIDVersion.NAME)
|
(isBuiltin(roleId) || version === RoleIDVersion.NAME)
|
||||||
) {
|
) {
|
||||||
const parts = roleId.split(SEPARATOR)
|
const parts = roleId.split(SEPARATOR)
|
||||||
|
|
|
@ -22,6 +22,10 @@ export class RoleAPI extends TestAPI {
|
||||||
}
|
}
|
||||||
|
|
||||||
save = async (body: SaveRoleRequest, expectations?: Expectations) => {
|
save = async (body: SaveRoleRequest, expectations?: Expectations) => {
|
||||||
|
// the tests should always be creating the "new" version of roles
|
||||||
|
if (body.version === undefined) {
|
||||||
|
body.version = "name"
|
||||||
|
}
|
||||||
return await this._post<SaveRoleResponse>(`/api/roles`, {
|
return await this._post<SaveRoleResponse>(`/api/roles`, {
|
||||||
body,
|
body,
|
||||||
expectations,
|
expectations,
|
||||||
|
|
Loading…
Reference in New Issue