本文整理汇总了TypeScript中@stencil/core/testing.E2EElement类的典型用法代码示例。如果您正苦于以下问题:TypeScript E2EElement类的具体用法?TypeScript E2EElement怎么用?TypeScript E2EElement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了E2EElement类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should show invalid range validation message', async () => {
element.setProperty('value', '2015-10-01');
await input.press('2');
await page.waitForChanges();
const errorMessage = await page.find('.dot-field__error-meessage');
expect(errorMessage.innerHTML).toBe('Invalid Date Range');
});
示例2: it
it('should mark as invalid when value dont match REgex', async () => {
element.setProperty('regexCheck', '^[A-Za-z ]+$');
await input.press('@');
await page.waitForChanges();
expect(element).toHaveClasses(['dot-invalid']);
});
示例3: it
it('should clear value, set pristine and untouched when input set reset', async () => {
element.callMethod('reset');
await page.waitForChanges();
expect(element.classList.contains('dot-pristine')).toBe(true);
expect(element.classList.contains('dot-untouched')).toBe(true);
expect(element.classList.contains('dot-invalid')).toBe(true);
expect(await input.getProperty('value')).toBe('');
});
示例4: 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);
});
示例5: 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();
});