本文整理汇总了TypeScript中@stencil/core/testing.TestWindow.load方法的典型用法代码示例。如果您正苦于以下问题:TypeScript TestWindow.load方法的具体用法?TypeScript TestWindow.load怎么用?TypeScript TestWindow.load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@stencil/core/testing.TestWindow
的用法示例。
在下文中一共展示了TestWindow.load方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: beforeEach
beforeEach(async () => {
window = new TestWindow();
element = await window.load({
components: [MadnessEnjineer],
html: '<madness-enjineer></madness-enjineer>'
});
});
示例2: it
it('should pass properties down to <input>', async () => {
const win = new TestWindow();
const el = await win.load({
components: [Toggle],
html: '<ion-toggle disabled checked value="coding" name="primary"></ion-toggle>'
}) as HTMLIonToggleElement;
expect(el.disabled).toBe(true);
expect(el.checked).toBe(true);
expect(el.value).toBe('coding');
expect(el.name).toBe('primary');
const input = getInput(el);
expect(input).toHaveProperties({
disabled: true,
checked: true,
value: 'coding',
name: 'primary'
});
el.disabled = false;
el.checked = false;
el.value = 'design';
el.name = 'secondary';
await win.flush();
expect(input.disabled).toBe(false);
expect(input.checked).toBe(false);
expect(input.value).toBe('design');
expect(input.name).toBe('secondary');
});
示例3: beforeEach
beforeEach(async () => {
testWindow = new TestWindow();
element = await testWindow.load({
components: [MyComponent],
html: '<my-component></my-component>'
});
});