From a8dc61362757e24fe3aaceaf4ea70f47fb3f9019 Mon Sep 17 00:00:00 2001 From: Brandy Carney Date: Tue, 16 Aug 2016 18:29:33 -0400 Subject: [PATCH] test(button): fix karma tests for the new button syntax --- src/components/button/test/button.spec.ts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/components/button/test/button.spec.ts b/src/components/button/test/button.spec.ts index 4d1dba5e2f..96d9f184c5 100644 --- a/src/components/button/test/button.spec.ts +++ b/src/components/button/test/button.spec.ts @@ -163,12 +163,6 @@ export function run() { expect(hasClass(b, 'button-small')).toEqual(true); }); - it('should not add button css class for ion-item attribute', () => { - let b = mockButton(['ion-item']); - b._assignCss(true); - expect(hasClass(b, 'button')).toEqual(false); - }); - it('should add button css class', () => { let b = mockButton(); b._assignCss(true); @@ -193,10 +187,17 @@ export function run() { expect(b._display).toEqual(null); }); + it('should add alert-button css class', () => { + let b = mockButton(null, null, 'alert-button'); + b._assignCss(true); + expect(hasClass(b, 'alert-button')).toEqual(true); + }); + }); - function mockButton(attrs?, config?) { + function mockButton(attrs?, config?, ionButton?) { config = config || new Config(); + ionButton = ionButton || ''; let elementRef = { nativeElement: document.createElement('button') }; @@ -210,7 +211,7 @@ export function run() { nativeElement.classList[shouldAdd ? 'add' : 'remove'](className); } }; - let b = new Button(config, elementRef, renderer, null); + let b = new Button(ionButton, config, elementRef, renderer, null); b._init = true; return b; }