Files
angular__angular/e2e/components/button-e2e.spec.ts
T
Kristiyan Kostadinov 33edff5f14 build: update jasmine for improved type safety (#8350)
* Bumps the version of Jasmine to allow for better type safety in the assertions.
* Fixes a few new compilation errors.
2017-11-13 18:55:53 -08:00

27 lines
958 B
TypeScript

import {browser, by, element, ExpectedConditions} from 'protractor';
import {screenshot} from '../screenshot';
describe('button', () => {
describe('disabling behavior', () => {
beforeEach(() => browser.get('/button'));
it('should prevent click handlers from executing when disabled', async () => {
element(by.id('test-button')).click();
expect(await element(by.id('click-counter')).getText()).toEqual('1');
await browser.wait(ExpectedConditions.not(
ExpectedConditions.presenceOf(element(by.css('div.mat-ripple-element')))));
screenshot('clicked once');
element(by.id('disable-toggle')).click();
element(by.id('test-button')).click();
expect(await element(by.id('click-counter')).getText()).toEqual('1');
await browser.wait(ExpectedConditions.not(
ExpectedConditions.presenceOf(element(by.css('div.mat-ripple-element')))));
screenshot('click disabled');
});
});
});