diff --git a/e2e/components/button/button.e2e.js b/e2e/components/button/button.e2e.js new file mode 100644 index 000000000000..84c60f5e1194 --- /dev/null +++ b/e2e/components/button/button.e2e.js @@ -0,0 +1,17 @@ +describe('button', function () { + describe('disabling behavior', function () { + beforeEach(function() { + browser.get('/button'); + }); + it('should prevent click handlers from executing when disabled', function () { + element(by.id('testButton')).click(); + expect(element(by.id('clickCounter')).getText()).toEqual('1'); + + element(by.id('disableToggle')).click(); + element(by.id('testButton')).click(); + expect(element(by.id('clickCounter')).getText()).toEqual('1'); + }); + }); +}); + + diff --git a/src/demo-app/button/button-demo.html b/src/demo-app/button/button-demo.html index 1ae4c5e395d9..a6e25ecb431c 100644 --- a/src/demo-app/button/button-demo.html +++ b/src/demo-app/button/button-demo.html @@ -1,17 +1,4 @@
-
- Link - link - Button - -
-
- Link - link - Button - -
-
@@ -74,10 +61,10 @@
- isDisabled: {{isDisabled}} - +

isDisabled: {{isDisabled}}, clickCounter: {{clickCounter}}

+
- + off @@ -89,4 +76,16 @@ favorite
+
+ Link + link + Button + +
+
+ Link + link + Button + +
diff --git a/src/demo-app/button/button-demo.scss b/src/demo-app/button/button-demo.scss index 7e2ab618088e..8e826dc48cc9 100644 --- a/src/demo-app/button/button-demo.scss +++ b/src/demo-app/button/button-demo.scss @@ -9,5 +9,9 @@ background-color: #f7f7f7; margin: 8px; } + + p { + padding:5px 15px; + } } diff --git a/src/demo-app/button/button-demo.ts b/src/demo-app/button/button-demo.ts index 60ec01fa0aa6..8304c19ac193 100644 --- a/src/demo-app/button/button-demo.ts +++ b/src/demo-app/button/button-demo.ts @@ -9,5 +9,5 @@ import {MdButton, MdAnchor} from '../../components/button/button'; }) export class ButtonDemo { isDisabled: boolean = false; - + clickCounter: number = 0; }