mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-18 21:21:06 +02:00
* update ldap mirage scenario to allow check-in/check-out action * update libraries test to mount engine * update mirage, fix tests * update lease renew CLI command * fix test * update tests
41 lines
1.1 KiB
JavaScript
41 lines
1.1 KiB
JavaScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
import { visit, currentURL } from '@ember/test-helpers';
|
|
|
|
export const createSecretsEngine = (store) => {
|
|
store.pushPayload('secret-engine', {
|
|
modelName: 'secret-engine',
|
|
data: {
|
|
accessor: 'ldap_7e838627',
|
|
path: 'ldap-test/',
|
|
type: 'ldap',
|
|
},
|
|
});
|
|
return store.peekRecord('secret-engine', 'ldap-test');
|
|
};
|
|
|
|
export const generateBreadcrumbs = (backend, childRoute) => {
|
|
const breadcrumbs = [{ label: 'Secrets', route: 'secrets', linkExternal: true }];
|
|
const root = { label: backend };
|
|
if (childRoute) {
|
|
root.route = 'overview';
|
|
breadcrumbs.push({ label: childRoute });
|
|
}
|
|
breadcrumbs.splice(1, 0, root);
|
|
return breadcrumbs;
|
|
};
|
|
|
|
const baseURL = (backend) => `/vault/secrets/${backend}/ldap/`;
|
|
const stripLeadingSlash = (uri) => (uri.charAt(0) === '/' ? uri.slice(1) : uri);
|
|
|
|
export const isURL = (uri, backend = 'ldap-test') => {
|
|
return currentURL() === `${baseURL(backend)}${stripLeadingSlash(uri)}`;
|
|
};
|
|
|
|
export const visitURL = (uri, backend = 'ldap-test') => {
|
|
return visit(`${baseURL(backend)}${stripLeadingSlash(uri)}`);
|
|
};
|