本文整理汇总了TypeScript中@ephox/agar.UiControls.sSetValue方法的典型用法代码示例。如果您正苦于以下问题:TypeScript UiControls.sSetValue方法的具体用法?TypeScript UiControls.sSetValue怎么用?TypeScript UiControls.sSetValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@ephox/agar.UiControls
的用法示例。
在下文中一共展示了UiControls.sSetValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: menu
(doc, body, gui, component, store) => {
const input = component.getSystem().getByDom(
SelectorFind.descendant(component.element(), 'input').getOrDie(
'Could not find input'
)
).getOrDie();
return [
TestHelpers.GuiSetup.mAddStyles(doc, [
'.tox-menu { background: white; }',
'.tox-collection__item--active { background: #cadbee }'
]),
Step.sync(() => {
Focusing.focus(input);
}),
Keyboard.sKeydown(doc, Keys.down(), { }),
Waiter.sTryUntil(
'Waiting for menu to appear',
UiFinder.sExists(
sink,
'.tox-menu .tox-collection__item'
),
100,
4000
),
Chain.asStep(sink, [
UiFinder.cFindIn('[role="menu"]'),
Assertions.cAssertStructure(
'Checking structure of menu (especially text)',
ApproxStructure.build((s, str, arr) => {
return s.element('div', {
classes: [ arr.has('tox-menu'), arr.has('tox-collection--list'), arr.has('tox-collection') ],
children: [
s.element('div', {
classes: [ arr.has('tox-collection__group') ],
children: [
s.element('div', {
classes: [ arr.has('tox-collection__item')],
children: [
s.element('div', { html: str.is('Header1') })
]
}),
s.element('div', {
classes: [ arr.has('tox-collection__item')],
children: [
s.element('div', { html: str.is('Header2') })
]
})
]
}),
s.element('div', {
classes: [ arr.has('tox-collection__group') ],
children: [
s.element('div', {
children: [
s.element('div', { html: str.is('<top>') })
]
})
]
})
]
});
})
)
]),
UiControls.sSetValue(input.element(), 'He'),
Step.sync(() => {
AlloyTriggers.emit(input, NativeEvents.input());
}),
Waiter.sTryUntil(
'Waiting for the menu to update',
Chain.asStep(sink, [
UiFinder.cFindAllIn('.tox-collection__item'),
Chain.op((menuItems) => {
if (menuItems.length > 2) {
throw Error('Menu hasn\'t been updated yet');
}
})
]),
100,
3000
),
Chain.asStep(sink, [
UiFinder.cFindIn('[role="menu"]'),
Assertions.cAssertStructure(
'Checking the menu shows items that match the input string',
ApproxStructure.build((s, str, arr) => {
return s.element('div', {
classes: [ arr.has('tox-menu'), arr.has('tox-collection--list'), arr.has('tox-collection') ],
children: [
s.element('div', {
classes: [ arr.has('tox-collection__group') ],
children: [
s.element('div', {
classes: [ arr.has('tox-collection__item')],
//.........这里部分代码省略.........