MCPcopy
hub / github.com/bugy/script-server / setValueByUser

Function setValueByUser

web-src/tests/unit/admin/ParameterConfigForm_test.js:14–27  ·  view source on GitHub ↗
(form, parameterName, value)

Source from the content-addressed store, hash-verified

12import {attachToDocument, createScriptServerTestVue, setChipListValue, vueTicks} from '../test_utils';
13
14export async function setValueByUser(form, parameterName, value) {
15 const childComponent = findField(form, parameterName);
16
17 if (childComponent.$options._componentTag === ChipsList.name) {
18 setChipListValue(childComponent, value);
19 return;
20 }
21
22 const inputField = findFieldInputElement(form, parameterName);
23
24 setInputValue(inputField, value, true);
25
26 await vueTicks();
27}
28
29export const findField = (form, expectedName, failOnMissing = true) => {
30 for (const child of form.$children) {

Callers 3

_setValueByUserFunction · 0.90
setValueFunction · 0.90
_setValueByUserFunction · 0.85

Calls 5

setChipListValueFunction · 0.90
setInputValueFunction · 0.90
vueTicksFunction · 0.90
findFieldFunction · 0.85
findFieldInputElementFunction · 0.85

Tested by

no test coverage detected