From 42595f241fba5c17a0c10f1454a1afafd833483a Mon Sep 17 00:00:00 2001 From: Cory LaViska Date: Mon, 20 Sep 2021 23:20:29 -0400 Subject: [PATCH] fix test --- src/components/badge/badge.test.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/badge/badge.test.ts b/src/components/badge/badge.test.ts index ba1a09626..eaaea1b8c 100644 --- a/src/components/badge/badge.test.ts +++ b/src/components/badge/badge.test.ts @@ -4,7 +4,7 @@ import '../../../dist/shoelace.js'; import type SlBadge from './badge'; describe('', () => { - let el; + let el: SlBadge; describe('when provided no parameters', async () => { before(async () => { @@ -24,7 +24,7 @@ describe('', () => { it('should default to square styling, with the primary color', async () => { const part = el.shadowRoot?.querySelector('[part="base"]') as HTMLElement; - expect(part.classList.value).to.eq('badge badge--primary'); + expect(part.classList.value.trim()).to.eq('badge badge--primary'); }); }); @@ -39,7 +39,7 @@ describe('', () => { it('should append the pill class to the classlist to render a pill', async () => { const part = el.shadowRoot?.querySelector('[part="base"]') as HTMLElement; - expect(part.classList.value).to.eq('badge badge--primary badge--pill'); + expect(part.classList.value.trim()).to.eq('badge badge--primary badge--pill'); }); }); @@ -54,14 +54,14 @@ describe('', () => { it('should append the pulse class to the classlist to render a pulse', async () => { const part = el.shadowRoot?.querySelector('[part="base"]') as HTMLElement; - expect(part.classList.value).to.eq('badge badge--primary badge--pulse'); + expect(part.classList.value.trim()).to.eq('badge badge--primary badge--pulse'); }); }); ['primary', 'success', 'neutral', 'warning', 'danger'].forEach(type => { describe(`when passed a type attribute ${type}`, () => { before(async () => { - el = await fixture(html`Badge`); + el = await fixture(html`Badge`); }); it('should render a component that passes accessibility test', async () => { @@ -70,7 +70,7 @@ describe('', () => { it('should default to square styling, with the primary color', async () => { const part = el.shadowRoot?.querySelector('[part="base"]') as HTMLElement; - expect(part.classList.value).to.eq(`badge badge--${type}`); + expect(part.classList.value.trim()).to.eq(`badge badge--${type}`); }); }); });