chore(material): add simple e2e smoke tests for components.

This commit is contained in:
Jeremy Elbourn
2015-05-04 18:34:06 -07:00
parent 93c331d103
commit 20a033e4c9
22 changed files with 137 additions and 66 deletions

View File

@ -19,7 +19,7 @@ import {NumberWrapper} from 'angular2/src/facade/lang';
'tabindex': 'tabindex',
'role': 'attr.role',
'checked': 'attr.aria-checked',
'disabled_': 'attr.aria-disabled'
'disabled': 'attr.aria-disabled'
}
})
@View({
@ -31,7 +31,7 @@ export class MdCheckbox {
checked: boolean;
/** Whether this checkbox is disabled. */
disabled_: boolean;
_disabled: boolean;
/** Setter for `role` attribute. */
role: string;
@ -43,14 +43,15 @@ export class MdCheckbox {
this.role = 'checkbox';
this.checked = false;
this.tabindex = isPresent(tabindex) ? NumberWrapper.parseInt(tabindex, 10) : 0;
this._disabled = false;
}
get disabled() {
return this.disabled_;
return this._disabled;
}
set disabled(value) {
this.disabled_ = isPresent(value) && value !== false;
this._disabled = isPresent(value) && value !== false;
}
onKeydown(event: KeyboardEvent) {

View File

@ -77,8 +77,8 @@ export class MdRadioButton {
constructor(
@Optional() @Parent() radioGroup: MdRadioGroup,
@Attribute('id') id: string,
@Attribute('tabindex') tabindex: string,
@Attribute('id') id: String,
@Attribute('tabindex') tabindex: String,
radioDispatcher: MdRadioDispatcher) {
// Assertions. Ideally these should be stripped out by the compiler.
// TODO(jelbourn): Assert that there's no name binding AND a parent radio group.
@ -213,8 +213,8 @@ export class MdRadioGroup {
role: string;
constructor(
@Attribute('tabindex') tabindex: string,
@Attribute('disabled') disabled: string,
@Attribute('tabindex') tabindex: String,
@Attribute('disabled') disabled: String,
radioDispatcher: MdRadioDispatcher) {
this.name_ = `md-radio-group-${_uniqueIdCounter++}`;
this.radios_ = [];