当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript harness.Harness类代码示例

本文整理汇总了TypeScript中@dojo/test-extras/harness.Harness的典型用法代码示例。如果您正苦于以下问题:TypeScript Harness类的具体用法?TypeScript Harness怎么用?TypeScript Harness使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Harness类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: harness

const { registerSuite } = intern.getInterface('object');

import harness, { Harness } from '@dojo/test-extras/harness';
import { v } from '@dojo/widget-core/d';

import Tab from '../../Tab';
import * as css from '../../../theme/tabcontroller/tabController.m.css';

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'
			}, []));
		},
开发者ID:dylans,项目名称:widgets,代码行数:30,代码来源:Tab.ts

示例2: harness

const { registerSuite } = intern.getInterface('object');
const { assert } = intern.getPlugin('chai');

import harness, { Harness } from '@dojo/test-extras/harness';
import { v } from '@dojo/widget-core/d';

import CalendarCell from '../../CalendarCell';
import * as css from '../../styles/calendar.m.css';

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,
开发者ID:bitpshr,项目名称:widgets,代码行数:31,代码来源:CalendarCell.ts

示例3:

	it('defaults max width to 100', () => {
		widget.setProperties({
			value: 50
		});

		widget.expectRender(expectedVDom({ width: 50, output: '50%', value: 50 }));
	});
开发者ID:dylans,项目名称:widgets,代码行数:7,代码来源:Progress.ts

示例4: expectedVDom

	it('accepts aria properties', () => {
		widget.setProperties({
			value: 50,
			aria: {
				describedBy: 'foo',
				valueNow: 'overridden'
			}
		});

		const expected = expectedVDom({ width: 50, output: '50%', value: 50 });
		assignChildProperties(expected, '0', {
			'aria-describedby': 'foo'
		});
		widget.expectRender(expected);
	});
开发者ID:dylans,项目名称:widgets,代码行数:15,代码来源:Progress.ts


注:本文中的@dojo/test-extras/harness.Harness类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。