mirror of
https://github.com/sartography/spiffworkflow-frontend.git
synced 2025-02-24 12:18:17 +00:00
add basic test for new breadcrumb stuff
This commit is contained in:
parent
bd3be87ac9
commit
56e8efb76c
@ -12,6 +12,20 @@ test('renders home link', () => {
|
|||||||
expect(homeElement).toBeInTheDocument();
|
expect(homeElement).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('renders hotCrumbs', () => {
|
||||||
|
render(
|
||||||
|
<BrowserRouter>
|
||||||
|
<ProcessBreadcrumb
|
||||||
|
hotCrumbs={[['Process Groups', '/admin'], [`Process Group: hey`]]}
|
||||||
|
/>
|
||||||
|
</BrowserRouter>
|
||||||
|
);
|
||||||
|
const homeElement = screen.getByText(/Process Groups/);
|
||||||
|
expect(homeElement).toBeInTheDocument();
|
||||||
|
const nextElement = screen.getByText(/Process Group: hey/);
|
||||||
|
expect(nextElement).toBeInTheDocument();
|
||||||
|
});
|
||||||
|
|
||||||
test('renders process group when given processGroupId', async () => {
|
test('renders process group when given processGroupId', async () => {
|
||||||
render(
|
render(
|
||||||
<BrowserRouter>
|
<BrowserRouter>
|
||||||
|
@ -27,7 +27,7 @@ export default function ProcessBreadcrumb({
|
|||||||
const valueLabel = crumb[0];
|
const valueLabel = crumb[0];
|
||||||
const url = crumb[1];
|
const url = crumb[1];
|
||||||
return (
|
return (
|
||||||
<Breadcrumb.Item linkAs={Link} linkProps={{ to: url }}>
|
<Breadcrumb.Item key={valueLabel} linkAs={Link} linkProps={{ to: url }}>
|
||||||
{valueLabel}
|
{valueLabel}
|
||||||
</Breadcrumb.Item>
|
</Breadcrumb.Item>
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user