本文整理匯總了TypeScript中@stencil/core/testing.E2EElement.find方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript E2EElement.find方法的具體用法?TypeScript E2EElement.find怎麽用?TypeScript E2EElement.find使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@stencil/core/testing.E2EElement
的用法示例。
在下文中一共展示了E2EElement.find方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it('renders', async () => {
// tslint:disable-next-line:max-line-length
const expectedMarkup = `<dot-select name=\"testName\" label=\"testLabel\" hint=\"testHint\" options=\"|,valueA|1,valueB|2\" value=\"2\" required-message=\"testErrorMsg\" required=\"true\" class=\"dot-valid dot-pristine dot-untouched dot-required hydrated\"><div class=\"dot-field__label\"><label for=\"testName\">testLabel</label><span class=\"dot-field__required-mark\">*</span></div><select id=\"testName\"><option value=\"\"></option><option value=\"1\">valueA</option><option value=\"2\">valueB</option></select><span class=\"dot-field__hint\">testHint</span></dot-select>`;
const hint = await element.find('.dot-field__hint');
expect(element.outerHTML).toBe(expectedMarkup);
expect(hint).toBeTruthy();
});
示例2: it
it('should reset event', async () => {
const resetBtn = await element.find('button[type="button"]');
const expectedStatus = Object.assign({}, formStatus);
Object.keys(expectedStatus).forEach(e => expectedStatus[e] = '');
resetBtn.click();
await page.waitForChanges();
const data = await element.getProperty('value');
expect(data).toEqual(expectedStatus);
});
示例3: it
it('it should not render hint', async () => {
element.setProperty('hint', '');
await page.waitForChanges();
const hint = await element.find('.dot-field__hint');
expect(hint).toBeNull();
});