本文整理汇总了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' ])
]));
},