vault/ui/tests/helpers/config-ui/message-selectors.ts
Angel Garbarino a51c5ed362
Clean up button test selectors (#30694)
* clean up selectors file and then update testButton to buttonByAttr

* a lot but not really in the scheme of things

* fix component test failures

* fix acceptance test failures

* fix namespace selector

* clean up remaining tests

* another test

* last test

* small changes, but I have test failures

* a mess in custom messages, really hard to test because of test pollution.

* make data-test-submit vs data-test-save

* change other-methods to sign in with other methods

* clean up of failing test

* buttonByAttr to button

* clean up test pollution on config messages

* sweep of clean ups

* another round of small cleanups

* fix some message things, remaining oidc issue?

* use a runCmd to better delete things

* fix to amend for recent auth test changes

* remove skip
2025-06-10 16:25:34 -04:00

26 lines
1.3 KiB
TypeScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
export const CUSTOM_MESSAGES = {
// General selectors that are common between custom messages
inlineErrorMessage: `[data-test-inline-error-message]`,
unauthCreateFormInfo: '[data-test-unauth-info]',
navLink: '[data-test-sidebar-nav-link="Custom Messages"]',
radio: (radioName: string) => `[data-test-radio="${radioName}"]`,
field: (fieldName: string) => `[data-test-field="${fieldName}"]`,
input: (input: string) => `[data-test-input="${input}"]`,
fieldValidation: (fieldName: string) => `[data-test-validation-error="${fieldName}"]`,
modal: (name: string) => `[data-test-modal="${name}"]`,
modalTitle: (title: string) => `[data-test-modal-title="${title}"]`,
modalBody: (name: string) => `[data-test-modal-body="${name}"]`,
alert: (name: string) => `data-test-custom-alert=${name}`,
alertTitle: (name: string) => `[data-test-custom-alert-title="${name}"]`,
alertDescription: (name: string) => `[data-test-custom-alert-description="${name}"]`,
alertAction: (name: string) => `[data-test-custom-alert-action="${name}"]`,
badge: (name: string) => `[data-test-badge="${name}"]`,
tab: (name: string) => `[data-test-custom-messages-tab="${name}"]`,
listItem: (name: string) => `[data-test-list-item="${name}"]`,
};