-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into 193-review-textinput
- Loading branch information
Showing
12 changed files
with
327 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,16 @@ | ||
# v18.2.5 (Mon Jun 19 2023) | ||
|
||
#### 🐛 Bug Fix | ||
|
||
- 160 e2e tests [#197](https://github.com/Infineon/infineon-design-system-stencil/pull/197) ([email protected] [@verena-ifx](https://github.com/verena-ifx)) | ||
|
||
#### Authors: 2 | ||
|
||
- [@verena-ifx](https://github.com/verena-ifx) | ||
- verena-ifx ([email protected]) | ||
|
||
--- | ||
|
||
# v18.2.4 (Fri Jun 16 2023) | ||
|
||
#### 🐛 Bug Fix | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { newE2EPage } from '@stencil/core/testing'; | ||
|
||
describe('ifx-alert', () => { | ||
|
||
it('should render', async () => { | ||
const page = await newE2EPage(); | ||
await page.setContent('<ifx-alert></ifx-alert>'); | ||
|
||
const element = await page.find('ifx-alert'); | ||
expect(element).toHaveClass('hydrated'); | ||
}); | ||
|
||
it('should set the correct color', async () => { | ||
const page = await newE2EPage(); | ||
await page.setContent('<ifx-alert color="success"></ifx-alert>'); | ||
|
||
const element = await page.find('ifx-alert'); | ||
const color = await element.getProperty('color'); | ||
|
||
expect(color).toBe('success'); | ||
}); | ||
|
||
it('should set the correct icon', async () => { | ||
const page = await newE2EPage(); | ||
await page.setContent('<ifx-alert icon="cinfo24"></ifx-alert>'); | ||
|
||
const element = await page.find('ifx-alert'); | ||
const icon = await element.getProperty('icon'); | ||
|
||
expect(icon).toBe('cinfo24'); | ||
}); | ||
|
||
it('should display the correct icon', async () => { | ||
const page = await newE2EPage(); | ||
await page.setContent('<ifx-alert icon="cinfo24"></ifx-alert>'); | ||
|
||
const iconElement = await page.find('ifx-alert >>> .icon-wrapper > ifx-icon'); | ||
const iconProp = await iconElement.getProperty('icon'); | ||
|
||
expect(iconProp).toBe('cinfo24'); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { newE2EPage } from '@stencil/core/testing'; | ||
|
||
describe('ifx-badge', () => { | ||
|
||
it('should render', async () => { | ||
const page = await newE2EPage(); | ||
await page.setContent('<ifx-badge></ifx-badge>'); | ||
|
||
const element = await page.find('ifx-badge'); | ||
expect(element).toHaveClass('hydrated'); | ||
}); | ||
|
||
it('should display slotted content', async () => { | ||
const page = await newE2EPage(); | ||
await page.setContent('<ifx-badge>Test content</ifx-badge>'); | ||
|
||
const badgeContent = await page.evaluate(() => { | ||
const badge = document.querySelector('ifx-badge'); | ||
const slot = badge.shadowRoot.querySelector('slot'); | ||
const nodes = slot.assignedNodes(); | ||
return nodes[0].textContent; | ||
}); | ||
|
||
expect(badgeContent).toBe('Test content'); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import { newE2EPage } from '@stencil/core/testing'; | ||
|
||
describe('ifx-button', () => { | ||
|
||
it('should render', async () => { | ||
const page = await newE2EPage(); | ||
await page.setContent('<ifx-button></ifx-button>'); | ||
|
||
const element = await page.find('ifx-button'); | ||
expect(element).toHaveClass('hydrated'); | ||
}); | ||
|
||
it('should display slotted content', async () => { | ||
const page = await newE2EPage(); | ||
await page.setContent('<ifx-button>Button Text</ifx-button>'); | ||
|
||
const buttonText = await page.evaluate(() => { | ||
const button = document.querySelector('ifx-button'); | ||
const slot = button.shadowRoot.querySelector('slot'); | ||
const nodes = slot.assignedNodes(); | ||
return nodes[0].textContent; | ||
}); | ||
|
||
expect(buttonText).toBe('Button Text'); | ||
}); | ||
|
||
it('should set correct variant', async () => { | ||
const page = await newE2EPage(); | ||
await page.setContent('<ifx-button variant="outline"></ifx-button>'); | ||
|
||
const element = await page.find('ifx-button'); | ||
const variant = await element.getProperty('variant'); | ||
|
||
expect(variant).toBe('outline'); | ||
}); | ||
|
||
it('should set correct color', async () => { | ||
const page = await newE2EPage(); | ||
await page.setContent('<ifx-button color="danger"></ifx-button>'); | ||
|
||
const element = await page.find('ifx-button'); | ||
const color = await element.getProperty('color'); | ||
|
||
expect(color).toBe('danger'); | ||
}); | ||
|
||
it('should set correct size', async () => { | ||
const page = await newE2EPage(); | ||
await page.setContent('<ifx-button size="s"></ifx-button>'); | ||
|
||
const element = await page.find('ifx-button'); | ||
const size = await element.getProperty('size'); | ||
|
||
expect(size).toBe('s'); | ||
}); | ||
|
||
}); |
28 changes: 28 additions & 0 deletions
28
packages/components/src/components/card/card-headline/card-headline.e2e.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { newE2EPage } from '@stencil/core/testing'; | ||
|
||
describe('ifx-card-headline', () => { | ||
|
||
it('should render', async () => { | ||
const page = await newE2EPage(); | ||
await page.setContent('<ifx-card-headline></ifx-card-headline>'); | ||
|
||
const element = await page.find('ifx-card-headline'); | ||
expect(element).toHaveClass('hydrated'); | ||
}); | ||
|
||
it('should display slotted content', async () => { | ||
const page = await newE2EPage(); | ||
|
||
await page.setContent('<ifx-card-headline>Test content</ifx-card-headline>'); | ||
|
||
const headlineContent = await page.evaluate(() => { | ||
const headline = document.querySelector('ifx-card-headline'); | ||
const slot = headline.shadowRoot.querySelector('slot'); | ||
const nodes = slot.assignedNodes(); | ||
return nodes[0].textContent; | ||
}).catch(e => console.error(e)); | ||
|
||
expect(headlineContent).toBe('Test content'); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
packages/components/src/components/card/card-overline/card-overline.e2e.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { newE2EPage } from '@stencil/core/testing'; | ||
|
||
describe('ifx-card-overline', () => { | ||
|
||
it('should render', async () => { | ||
const page = await newE2EPage(); | ||
await page.setContent('<ifx-card-overline></ifx-card-overline>'); | ||
|
||
const element = await page.find('ifx-card-overline'); | ||
expect(element).toHaveClass('hydrated'); | ||
}); | ||
|
||
it('should display slotted content', async () => { | ||
const page = await newE2EPage(); | ||
await page.setContent('<ifx-card-overline>Card Overline</ifx-card-overline>'); | ||
|
||
const cardOverlineText = await page.evaluate(() => { | ||
const cardOverline = document.querySelector('ifx-card-overline'); | ||
const slot = cardOverline.shadowRoot.querySelector('slot'); | ||
const nodes = slot.assignedNodes(); | ||
return nodes[0].textContent; | ||
}); | ||
|
||
expect(cardOverlineText).toBe('Card Overline'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { newE2EPage } from '@stencil/core/testing'; | ||
|
||
describe('ifx-card', () => { | ||
|
||
it('should render', async () => { | ||
const page = await newE2EPage(); | ||
await page.setContent('<ifx-card></ifx-card>'); | ||
|
||
const element = await page.find('ifx-card'); | ||
expect(element).toHaveClass('hydrated'); | ||
}); | ||
|
||
it('should set correct direction', async () => { | ||
const page = await newE2EPage(); | ||
await page.setContent('<ifx-card direction="horizontal"></ifx-card>'); | ||
|
||
const element = await page.find('ifx-card'); | ||
const direction = await element.getProperty('direction'); | ||
|
||
expect(direction).toBe('horizontal'); | ||
}); | ||
|
||
it('should set correct alignment', async () => { | ||
const page = await newE2EPage(); | ||
await page.setContent('<ifx-card alignment="center"></ifx-card>'); | ||
|
||
const element = await page.find('ifx-card'); | ||
const alignment = await element.getProperty('alignment'); | ||
|
||
expect(alignment).toBe('center'); | ||
}); | ||
|
||
}); |
39 changes: 39 additions & 0 deletions
39
packages/components/src/components/checkbox/checkbox.e2e.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { newE2EPage } from '@stencil/core/testing'; | ||
|
||
describe('ifx-checkbox', () => { | ||
it('should render', async () => { | ||
const page = await newE2EPage(); | ||
await page.setContent('<ifx-checkbox></ifx-checkbox>'); | ||
|
||
const element = await page.find('ifx-checkbox'); | ||
expect(element).toHaveClass('hydrated'); | ||
}); | ||
|
||
it('should display slotted content', async () => { | ||
const page = await newE2EPage(); | ||
await page.setContent('<ifx-checkbox>Test content</ifx-checkbox>'); | ||
|
||
const labelContent = await page.evaluate(() => { | ||
const checkbox = document.querySelector('ifx-checkbox'); | ||
const slot = checkbox.shadowRoot.querySelector('slot'); | ||
const nodes = slot.assignedNodes(); | ||
return nodes[0].textContent; | ||
}); | ||
|
||
expect(labelContent).toBe('Test content'); | ||
}); | ||
|
||
it('should emit ifxChange event when clicked', async () => { | ||
const page = await newE2EPage(); | ||
await page.setContent('<ifx-checkbox></ifx-checkbox>'); | ||
|
||
const checkbox = await page.find('ifx-checkbox'); | ||
const ifxChange = await checkbox.spyOnEvent('ifxChange'); | ||
|
||
const checkboxWrapper = await page.find('ifx-checkbox >>> .checkbox__wrapper'); | ||
await checkboxWrapper.click(); | ||
|
||
expect(ifxChange).toHaveReceivedEvent(); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.