mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
411fce3901
Fixes an unused import that got into master. **Note:** targeting major, because I think that it got introduced in the PR for the checkbox design changes.
35 lines
1.1 KiB
TypeScript
35 lines
1.1 KiB
TypeScript
import {browser, by, element, Key} from 'protractor';
|
|
|
|
describe('checkbox', () => {
|
|
|
|
describe('check behavior', () => {
|
|
beforeEach(() => browser.get('/checkbox'));
|
|
|
|
it('should be checked when clicked, and unchecked when clicked again', async () => {
|
|
let checkboxEl = element(by.id('test-checkbox'));
|
|
let inputEl = element(by.css('input[id=test-checkbox-input]'));
|
|
|
|
checkboxEl.click();
|
|
|
|
expect(inputEl.getAttribute('checked'))
|
|
.toBeTruthy('Expect checkbox "checked" property to be true');
|
|
|
|
checkboxEl.click();
|
|
|
|
expect(inputEl.getAttribute('checked'))
|
|
.toBeFalsy('Expect checkbox "checked" property to be false');
|
|
});
|
|
|
|
it('should toggle the checkbox when pressing space', () => {
|
|
let inputEl = element(by.css('input[id=test-checkbox-input]'));
|
|
|
|
expect(inputEl.getAttribute('checked'))
|
|
.toBeFalsy('Expect checkbox "checked" property to be false');
|
|
inputEl.sendKeys(Key.SPACE);
|
|
|
|
expect(inputEl.getAttribute('checked'))
|
|
.toBeTruthy('Expect checkbox "checked" property to be true');
|
|
});
|
|
});
|
|
});
|