From c3c8856cb0f1ad50cd74c5e03196495a2e01a76c Mon Sep 17 00:00:00 2001 From: Gabriel Date: Wed, 16 Aug 2023 17:14:32 -0300 Subject: [PATCH] test: add tests badge component --- .../core/src/components/badge/badge.spec.ts | 39 ++++++++++++++++++- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/packages/core/src/components/badge/badge.spec.ts b/packages/core/src/components/badge/badge.spec.ts index 51afd5921..fc33794ef 100644 --- a/packages/core/src/components/badge/badge.spec.ts +++ b/packages/core/src/components/badge/badge.spec.ts @@ -1,3 +1,38 @@ -describe('AtomBadge', () => { - it('should render an ion-badge element', async () => {}) +import { newSpecPage } from '@stencil/core/testing' + +import { AtomBadge } from './badge' + +describe('atom-badge', () => { + it('should render an ion-badge element correctly', async () => { + const page = await newSpecPage({ + components: [AtomBadge], + html: `Badge`, + }) + + await page.waitForChanges() + + const badgeEl = page.root?.shadowRoot?.querySelector('ion-badge') + + expect(badgeEl).toBeTruthy() + }) + + it('should render badge element correctly', async () => { + const page = await newSpecPage({ + components: [AtomBadge], + html: `Badge`, + }) + + await page.waitForChanges() + + expect(page.root).toEqualHtml(` + + + + + + + Badge + + `) + }) })