Skip to content

Commit

Permalink
test: add new property size and shape
Browse files Browse the repository at this point in the history
  • Loading branch information
anabrook committed Feb 25, 2025
1 parent 761117b commit 5c49ce5
Showing 1 changed file with 48 additions and 8 deletions.
56 changes: 48 additions & 8 deletions packages/core/src/components/badge/badge.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('atom-badge', () => {
expect(page.root).toEqualHtml(`
<atom-badge type='primary'>
<mock:shadow-root>
<ion-badge color='primary' class="atom-badge">
<ion-badge color='primary' class="atom-badge" shape="round" size="default">
<slot></slot>
</ion-badge>
</mock:shadow-root>
Expand All @@ -47,7 +47,7 @@ describe('atom-badge', () => {
expect(page.root).toEqualHtml(`
<atom-badge type='secondary'>
<mock:shadow-root>
<ion-badge color='secondary' class="atom-badge">
<ion-badge color='secondary' class="atom-badge" shape="round" size="default">
<slot></slot>
</ion-badge>
</mock:shadow-root>
Expand All @@ -67,7 +67,7 @@ describe('atom-badge', () => {
expect(page.root).toEqualHtml(`
<atom-badge type='info'>
<mock:shadow-root>
<ion-badge color='info' class="atom-badge">
<ion-badge color='info' class="atom-badge" shape="round" size="default">
<slot></slot>
</ion-badge>
</mock:shadow-root>
Expand All @@ -87,7 +87,7 @@ describe('atom-badge', () => {
expect(page.root).toEqualHtml(`
<atom-badge type='success'>
<mock:shadow-root>
<ion-badge color='success' class="atom-badge">
<ion-badge color='success' class="atom-badge" shape="round" size="default">
<slot></slot>
</ion-badge>
</mock:shadow-root>
Expand All @@ -107,7 +107,7 @@ describe('atom-badge', () => {
expect(page.root).toEqualHtml(`
<atom-badge type='warning'>
<mock:shadow-root>
<ion-badge color='warning' class="atom-badge">
<ion-badge color='warning' class="atom-badge" shape="round" size="default">
<slot></slot>
</ion-badge>
</mock:shadow-root>
Expand All @@ -127,7 +127,7 @@ describe('atom-badge', () => {
expect(page.root).toEqualHtml(`
<atom-badge type='danger'>
<mock:shadow-root>
<ion-badge color='danger' class="atom-badge">
<ion-badge color='danger' class="atom-badge" shape="round" size="default">
<slot></slot>
</ion-badge>
</mock:shadow-root>
Expand All @@ -147,7 +147,7 @@ describe('atom-badge', () => {
expect(page.root).toEqualHtml(`
<atom-badge type='neutral'>
<mock:shadow-root>
<ion-badge color='neutral' class="atom-badge">
<ion-badge color='neutral' class="atom-badge" shape="round" size="default">
<slot></slot>
</ion-badge>
</mock:shadow-root>
Expand All @@ -167,7 +167,47 @@ describe('atom-badge', () => {
expect(page.root).toEqualHtml(`
<atom-badge type='dark'>
<mock:shadow-root>
<ion-badge color='dark' class="atom-badge">
<ion-badge color='dark' class="atom-badge" shape="round" size="default">
<slot></slot>
</ion-badge>
</mock:shadow-root>
Badge
</atom-badge>
`)
})

it('should add "ion-badge-rectangle" and large classes when shape prop is rectangle and size large', async () => {
const page = await newSpecPage({
components: [AtomBadge],
html: `<atom-badge type='primary' shape='rectangle' size='large'>Badge</atom-badge>`,
})

await page.waitForChanges()

expect(page.root).toEqualHtml(`
<atom-badge type='primary' shape='rectangle' size='large'>
<mock:shadow-root>
<ion-badge color='primary' class="atom-badge" shape="rectangle" size="large">
<slot></slot>
</ion-badge>
</mock:shadow-root>
Badge
</atom-badge>
`)
})

it('should add "ion-badge-rectangle" and medium classes when shape prop is rectangle and size medium', async () => {
const page = await newSpecPage({
components: [AtomBadge],
html: `<atom-badge type='primary' shape='rectangle' size='medium'>Badge</atom-badge>`,
})

await page.waitForChanges()

expect(page.root).toEqualHtml(`
<atom-badge type='primary' shape='rectangle' size='medium'>
<mock:shadow-root>
<ion-badge color='primary' class="atom-badge" shape="rectangle" size="medium">
<slot></slot>
</ion-badge>
</mock:shadow-root>
Expand Down

0 comments on commit 5c49ce5

Please sign in to comment.