-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ad2466e
commit 8bcd9a5
Showing
2 changed files
with
69 additions
and
3 deletions.
There are no files selected for viewing
68 changes: 68 additions & 0 deletions
68
packages/components/src/components/breadcrumb/breadcrumb.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,68 @@ | ||
import { newE2EPage } from '@stencil/core/testing'; | ||
|
||
describe('ifx-breadcrumb', () => { | ||
it('should render', async () => { | ||
const page = await newE2EPage(); | ||
await page.setContent('<ifx-breadcrumb></ifx-breadcrumb>'); | ||
|
||
const element = await page.find('ifx-breadcrumb'); | ||
expect(element).toHaveClass('hydrated'); | ||
}); | ||
|
||
it('should display breadcrumb items', async () => { | ||
const page = await newE2EPage(); | ||
await page.setContent(` | ||
<ifx-breadcrumb> | ||
<ifx-breadcrumb-item> | ||
<ifx-breadcrumb-item-label icon="home" url="/">Home</ifx-breadcrumb-item-label> | ||
</ifx-breadcrumb-item> | ||
<ifx-breadcrumb-item> | ||
<ifx-breadcrumb-item-label icon="chevron-right" url="/about">About</ifx-breadcrumb-item-label> | ||
</ifx-breadcrumb-item> | ||
</ifx-breadcrumb> | ||
`); | ||
|
||
const breadcrumb = await page.find('ifx-breadcrumb'); | ||
const breadcrumbItems = await breadcrumb.findAll('ifx-breadcrumb-item'); | ||
|
||
expect(breadcrumbItems.length).toBe(2); | ||
}); | ||
|
||
it('should handle last item correctly', async () => { | ||
const page = await newE2EPage(); | ||
await page.setContent(` | ||
<ifx-breadcrumb> | ||
<ifx-breadcrumb-item> | ||
<ifx-breadcrumb-item-label icon="home" url="/">Home</ifx-breadcrumb-item-label> | ||
</ifx-breadcrumb-item> | ||
<ifx-breadcrumb-item> | ||
<ifx-breadcrumb-item-label icon="chevron-right" url="/about">About</ifx-breadcrumb-item-label> | ||
</ifx-breadcrumb-item> | ||
</ifx-breadcrumb> | ||
`); | ||
|
||
const breadcrumbItems = await page.findAll('ifx-breadcrumb-item'); | ||
|
||
expect(breadcrumbItems[0]).not.toHaveAttribute('aria-current'); | ||
|
||
}); | ||
|
||
it('should toggle dropdown menu', async () => { | ||
const page = await newE2EPage(); | ||
await page.setContent(` | ||
<ifx-breadcrumb> | ||
<ifx-breadcrumb-item> | ||
<ifx-breadcrumb-item-label icon="home" url="/">Home</ifx-breadcrumb-item-label> | ||
</ifx-breadcrumb-item> | ||
<ifx-breadcrumb-item> | ||
<ifx-breadcrumb-item-label icon="chevron-right" url="/about">About</ifx-breadcrumb-item-label> | ||
</ifx-breadcrumb-item> | ||
</ifx-breadcrumb> | ||
`); | ||
|
||
await page.waitForChanges(); | ||
|
||
}); | ||
|
||
// Add more test cases as needed | ||
}); |
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