chore(tests): add testing for disabled inputs

This commit is contained in:
Ken Sodemann
2018-02-06 11:32:51 -06:00
parent 77b8527d76
commit fcbe1818fa
4 changed files with 93 additions and 15 deletions

View File

@ -14,6 +14,30 @@ describe('Basic Inputs Page', () => {
expect(page.getTitleText()).toEqual('Ionic Core Basic Inputs Demo');
});
describe('search input', () => {
it('should display the starting text', () => {
page.navigateTo();
const el = page.getIonicSearchInput();
expect(el.getAttribute('value')).toEqual(null);
});
it('should reflect back the entered data', () => {
page.navigateTo();
const el = page.getIonicSearchInputEditable();
el.clear();
el.sendKeys('I am new text');
expect(page.getSearchOutput()).toEqual('I am new text');
});
// it('should disable', () => {
// page.navigateTo();
// const inp = page.getIonicSearchInputEditable();
// const cb = page.getDisableButton();
// cb.click();
// expect(inp.isEnabled()).toEqual(false);
// });
});
describe('text input', () => {
it('should display the starting text', () => {
page.navigateTo();
@ -40,6 +64,14 @@ describe('Basic Inputs Page', () => {
inp.sendKeys('X');
expect(hasClass(el, 'ng-invalid')).toEqual(false);
});
it('should disable', () => {
page.navigateTo();
const inp = page.getIonicTextInputEditable();
const cb = page.getDisableButton();
cb.click();
expect(inp.isEnabled()).toEqual(false);
});
});
describe('numeric input', () => {
@ -56,6 +88,14 @@ describe('Basic Inputs Page', () => {
inp.sendKeys('.48859');
expect(page.getNumericOutputType()).toEqual('number');
});
it('should disable', () => {
page.navigateTo();
const inp = page.getIonicNumericInputEditable();
const cb = page.getDisableButton();
cb.click();
expect(inp.isEnabled()).toEqual(false);
});
});
describe('textarea input', () => {
@ -84,6 +124,14 @@ describe('Basic Inputs Page', () => {
inp.sendKeys('X');
expect(hasClass(el, 'ng-invalid')).toEqual(false);
});
it('should disable', () => {
page.navigateTo();
const inp = page.getIonicTextareaInputEditable();
const cb = page.getDisableButton();
cb.click();
expect(inp.isEnabled()).toEqual(false);
});
});
describe('checkbox input', () => {