From dc21607b2cd0ec4f5dfa8dda65b8eb137f7cc7b9 Mon Sep 17 00:00:00 2001 From: Jeremy Elbourn Date: Mon, 26 Sep 2016 19:53:37 +0100 Subject: [PATCH] chore(button): re-add ripples (#1332) --- src/lib/button/button.html | 5 +++++ src/lib/button/button.spec.ts | 15 +++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/lib/button/button.html b/src/lib/button/button.html index 4e3df0e22666..a1636be45494 100644 --- a/src/lib/button/button.html +++ b/src/lib/button/button.html @@ -1 +1,6 @@ +
diff --git a/src/lib/button/button.spec.ts b/src/lib/button/button.spec.ts index 85c0f7575a0b..e2bec8b31473 100644 --- a/src/lib/button/button.spec.ts +++ b/src/lib/button/button.spec.ts @@ -120,7 +120,22 @@ describe('MdButton', () => { fixture.detectChanges(); expect(buttonDebugElement.nativeElement.getAttribute('aria-disabled')).toBe('true'); }); + }); + + // Ripple tests. + describe('button ripples', () => { + it('should remove ripple if md-ripple-disabled input is set', () => { + let fixture = TestBed.createComponent(TestApp); + let testComponent = fixture.debugElement.componentInstance; + let buttonDebugElement = fixture.debugElement.query(By.css('button')); + fixture.detectChanges(); + expect(buttonDebugElement.nativeElement.querySelectorAll('[md-ripple]').length).toBe(1); + + testComponent.rippleDisabled = true; + fixture.detectChanges(); + expect(buttonDebugElement.nativeElement.querySelectorAll('[md-ripple]').length).toBe(0); + }); }); });