open-vault/ui/tests/helpers/pki/workflow.js

82 lines
2.9 KiB
JavaScript
Raw Normal View History

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
import { SELECTORS as ROLEFORM } from './pki-role-form';
import { SELECTORS as GENERATECERT } from './pki-role-generate';
import { SELECTORS as KEYFORM } from './pki-key-form';
import { SELECTORS as KEYPAGES } from './page/pki-keys';
2022-12-21 16:30:24 +00:00
import { SELECTORS as ISSUERDETAILS } from './pki-issuer-details';
import { SELECTORS as CONFIGURATION } from './pki-configure-create';
import { SELECTORS as DELETE } from './pki-delete-all-issuers';
2023-04-11 06:07:26 +00:00
import { SELECTORS as TIDY } from './page/pki-tidy-form';
import { SELECTORS as CONFIGEDIT } from './page/pki-configuration-edit';
import { SELECTORS as GENROOT } from './pki-generate-root';
2022-12-21 16:30:24 +00:00
2022-12-06 20:34:43 +00:00
export const SELECTORS = {
breadcrumbContainer: '[data-test-breadcrumbs]',
breadcrumbs: '[data-test-breadcrumbs] li',
overviewBreadcrumb: '[data-test-breadcrumbs] li:nth-of-type(2) > a',
2022-12-06 20:34:43 +00:00
pageTitle: '[data-test-pki-role-page-title]',
alertBanner: '[data-test-alert-banner="alert"]',
emptyState: '[data-test-component="empty-state"]',
emptyStateTitle: '[data-test-empty-state-title]',
emptyStateLink: '.empty-state-actions a',
emptyStateMessage: '[data-test-empty-state-message]',
2022-12-06 20:34:43 +00:00
// TABS
overviewTab: '[data-test-secret-list-tab="Overview"]',
rolesTab: '[data-test-secret-list-tab="Roles"]',
issuersTab: '[data-test-secret-list-tab="Issuers"]',
certsTab: '[data-test-secret-list-tab="Certificates"]',
keysTab: '[data-test-secret-list-tab="Keys"]',
UI: pki auto-tidy views (#20685) * UI: plumbing for pki tidy work (#20611) * update tidy model * Dynamic group on tidy based on version * UI: VAULT-16261 PKI autotidy config view (#20641) * UI: VAULT-16203 tidy status page (#20635) * ui: pki tidy form (#20630) * order routes to match tabs * add tidy routes * add tidy-status page component * update routes rename edit to configure, remove manage * add page component to route template * add comment * finish routing * change to queryRecord, delete old tidy file * remove findRecord * fix serializer name * tidy.index only needs controller empty state logic * build form and page components * update tidy model * alphabetize! * revert model changes * finish adapter * move form out of page folder in tests * refactor to accommodate model changes from chelseas pr * WIP tests * reuse shared fields in model * finish tests * update model hook and breadcrumbs * remove subtext for checkbox * fix tests add ACME fields * Update ui/app/adapters/pki/tidy.js * Update ui/app/adapters/pki/tidy.js * refactor intervalDuration using feedback suggested * move errors to second line, inside conditional brackets * add ternary operator to allByKey attr * surface error message * make polling request longer * UI: VAULT-16368 pki tidy custom method (#20696) * ui: adds empty state and updates modal (#20695) * add empty state to status page * update tidy modal * conditionally change cancel transition route for auto tidy form * teeny copy update * organize tidy-status conditoionals * a couple more template cleanups * fix conditional, change to settings * UI: VAULT-16367 VAULT-16378 Tidy acceptance tests + tidy toolbar cleanup (#20698) * update copy * move tidyRevokedCertIssuerAssociations up to applicable section * add tidy info to readme * update copy * UI: Add tidy as a tab to the error route (#20723) * small cleanup items * fix prettier * cancel polling when we leave tidy.index (status view) * revert changes to declaration file * remove space --------- Co-authored-by: Chelsea Shaw <cshaw@hashicorp.com> Co-authored-by: Chelsea Shaw <82459713+hashishaw@users.noreply.github.com> Co-authored-by: Kianna <30884335+kiannaquach@users.noreply.github.com>
2023-05-23 23:05:15 +00:00
tidyTab: '[data-test-secret-list-tab="Tidy"]',
2022-12-06 20:34:43 +00:00
configTab: '[data-test-secret-list-tab="Configuration"]',
// ROLES
deleteRoleButton: '[data-test-pki-role-delete]',
generateCertLink: '[data-test-pki-role-generate-cert]',
signCertLink: '[data-test-pki-role-sign-cert]',
editRoleLink: '[data-test-pki-role-edit-link]',
createRoleLink: '[data-test-pki-role-create-link]',
roleForm: {
...ROLEFORM,
},
generateCertForm: {
...GENERATECERT,
},
// KEYS
keyForm: {
...KEYFORM,
},
keyPages: {
...KEYPAGES,
},
// ISSUERS
issuerListItem: (id) => `[data-test-issuer-list="${id}"]`,
importIssuerLink: '[data-test-generate-issuer="import"]',
generateIssuerDropdown: '[data-test-issuer-generate-dropdown]',
generateIssuerRoot: '[data-test-generate-issuer="root"]',
generateIssuerIntermediate: '[data-test-generate-issuer="intermediate"]',
UI: pki rotate root cert (#19739) * add rotate root route * add page component * add modal * fix modal image styling * add radio buttons * add jsonToCert function to pki parser * add verify function * add verify to details route * nest rotate-root under issuer/ * copy values from old root ca * pull detail info rows into a separate component * add type declaration files * add parsing error warning to rotate root component file * add comments * add capabilities to controller * update icon * revert issuer details * refactor pki info table rows * add parsedparameters to pki helper * add alert banner * update attrs, fix info rows * add endpoint to action router * update alert banner * hide toolbar from generate root display * add download buttons to toolbar * add banner getter * fix typo in issuer details * fix assertion * move alert banner after generating root to parent * rename issuer index route file * refactor routing so model can be passed from route * add confirmLeave and done button to use existin settings done form * rename serial number to differentiate between two types * fix links, update ids to issuerId not response id * update ts declaration * change variable names add comments * update existing tests * fix comment typo * add download button test * update serializer to change subject_serial_number to serial_number for backend * remove pageTitle getter * remove old arg * round 1 of testing complete.. * finish endpoint tests * finish component tests * move toolbars to parent route * add acceptance test for rotate route * add const to hold radio button string values * remove action, fix link
2023-03-31 21:47:23 +00:00
issuerPopupMenu: '[data-test-popup-menu-trigger]',
issuerPopupDetails: '[data-test-popup-menu-details] a',
2022-12-21 16:30:24 +00:00
issuerDetails: {
title: '[data-test-pki-issuer-page-title]',
...ISSUERDETAILS,
},
// CONFIGURATION
configuration: {
title: '[data-test-pki-configuration-page-title]',
emptyState: '[data-test-configuration-empty-state]',
pkiBetaBanner: '[data-test-pki-configuration-banner]',
pkiBetaBannerLink: '[data-test-pki-configuration-banner] a',
...CONFIGURATION,
...DELETE,
2023-04-11 06:07:26 +00:00
...TIDY,
...GENROOT,
},
// EDIT CONFIGURATION
configEdit: {
...CONFIGEDIT,
},
2022-12-06 20:34:43 +00:00
};