本文整理汇总了TypeScript中@dojo/test-extras/harness.Harness.getRender方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Harness.getRender方法的具体用法?TypeScript Harness.getRender怎么用?TypeScript Harness.getRender使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@dojo/test-extras/harness.Harness
的用法示例。
在下文中一共展示了Harness.getRender方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: isOpen
function isOpen(widget: Harness<ComboBox>): boolean {
const vdom = widget.getRender();
return (vdom as any)!.properties!['aria-expanded'] === 'true';
}
示例2: onClick
widget.sendEvent('click', { selector: 'button' });
assert.isTrue(onCloseClick.called, 'onCloseClick handler called when close button clicked');
},
onClick() {
const onClick = sinon.stub();
widget.setProperties(props({ onClick }));
widget.sendEvent('click');
assert.isTrue(onClick.calledOnce, 'onClick handler called when tab is clicked');
assert.isTrue(onClick.calledWith(0), 'onClick called with index as argument');
widget.setProperties(props({
disabled: true,
onClick
}));
widget.getRender();
widget.sendEvent('click');
assert.isTrue(onClick.calledOnce, 'onClick handler not called when tab is disabled');
},
'keyboard navigation'() {
const onDownArrowPress = sinon.stub();
const onEndPress = sinon.stub();
const onHomePress = sinon.stub();
const onLeftArrowPress = sinon.stub();
const onRightArrowPress = sinon.stub();
const onUpArrowPress = sinon.stub();
widget.setProperties(props({
onDownArrowPress,
onEndPress,
示例3: v
]
}, [
null,
slidePaneVDom,
buttonVDom
]),
v('div', {
classes: [
css.content,
fixedCss.contentFixed
]
}, [])
]));
toolbar.sendEvent('click', { selector: `.${css.menuButton}` });
toolbar.getRender();
toolbar.callListener('onRequestClose', { key: 'slide-pane-menu' });
toolbar.expectRender(v('div', {
classes: [
css.root,
fixedCss.rootFixed,
css.collapsed,
fixedCss.onTopFixed
],
key: 'root',
dir: null,
lang: null
}, [
v('div', {
classes: [