本文整理匯總了TypeScript中@dojo/test-extras/harness.Harness.setProperties方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Harness.setProperties方法的具體用法?TypeScript Harness.setProperties怎麽用?TypeScript Harness.setProperties使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@dojo/test-extras/harness.Harness
的用法示例。
在下文中一共展示了Harness.setProperties方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it('defaults max width to 100', () => {
widget.setProperties({
value: 50
});
widget.expectRender(expectedVDom({ width: 50, output: '50%', value: 50 }));
});
示例2: registerSuite
let widget: Harness<Tab>;
registerSuite('Tab', {
beforeEach() {
widget = harness(Tab);
},
afterEach() {
widget.destroy();
},
tests: {
'default properties'() {
widget.setProperties({ key: 'foo' });
widget.expectRender(v('div', {
'aria-labelledby': undefined,
classes: css.tab,
id: undefined,
role: 'tabpanel'
}, []));
},
'custom properties and children'() {
const testChildren = [
v('p', ['lorem ipsum']),
v('a', { href: '#foo'}, [ 'foo' ])
];
widget.setProperties({
aria: { describedBy: 'foo' },
示例3: registerSuite
let widget: Harness<CalendarCell>;
registerSuite('CalendarCell', {
beforeEach() {
widget = harness(CalendarCell);
},
afterEach() {
widget.destroy();
},
tests: {
'Calendar cell with default properties'() {
widget.setProperties({
date: 1
});
widget.expectRender(v('td', {
key: 'root',
role: 'gridcell',
'aria-selected': 'false',
tabIndex: -1,
classes: [ css.date, null, null, null ],
onclick: widget.listener,
onkeydown: widget.listener
}, [
v('span', {}, [ '1' ])
]));
},