vault/ui/tests/pages/components/form-field.js
Shannon Roberts (Beagin) 659f1b1ada
[VAULT-37108] UI: update toggle-input test selectors (#31087)
* [VAULT-37108] UI: update toggle-input test selectors
- update namespace-picker to data-test-button

* - replace instances of data-test-toggle-input with general selector

* - replace enableDefaultTtl() and enableMaxTtl()  with general selector

* - replace toggleJson with general selector

* - replace toggleButton with general selector

* - replace toggleTtl() with general selector

* - replace hasToggleButton() with general selector

* - replace hasTTLPicker() with general selector

* - replace toggleDiff with general selector

* fix lint error :]

* fix failing test
2025-06-26 09:18:01 -06:00

50 lines
1.5 KiB
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1
*/
import {
attribute,
focusable,
value,
clickable,
isPresent,
collection,
fillable,
triggerable,
text,
} from 'ember-cli-page-object';
export default {
hasStringList: isPresent('[data-test-component=string-list]'),
hasTextFile: isPresent('[data-test-component=text-file]'),
hasJSONEditor: isPresent('[data-test-component="code-mirror-modifier"]'),
hasJSONClearButton: isPresent('[data-test-json-clear-button]'),
hasInput: isPresent('input'),
hasCheckbox: isPresent('input[type=checkbox]'),
hasTextarea: isPresent('textarea'),
hasMaskedInput: isPresent('[data-test-masked-input]'),
hasTooltip: isPresent('[data-test-component=info-tooltip]'),
tooltipTrigger: focusable('[data-test-tool-tip-trigger]'),
radioButtons: collection('input[type=radio]', {
select: clickable(),
id: attribute('id'),
}),
fields: collection('[data-test-field]', {
clickLabel: clickable('label'),
labelValue: text('[data-test-form-field-label]'),
input: fillable('input'),
ttlTime: fillable('[data-test-ttl-value]'),
select: fillable('select'),
textarea: fillable('textarea'),
change: triggerable('keyup', '.input'),
inputValue: value('input'),
textareaValue: value('textarea'),
inputChecked: attribute('checked', 'input[type=checkbox]'),
}),
selectRadioInput: async function (value) {
return this.radioButtons.filterBy('id', value)[0].select();
},
};