本文整理匯總了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: [