chore: fixing tests

Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
blam
2024-07-23 08:19:53 +02:00
parent 678971ad41
commit d4e33aca1a
2 changed files with 4 additions and 3 deletions
@@ -162,14 +162,15 @@ describe('RoutedTabs', () => {
});
it('should render the tabs as <a> links', async () => {
const routes = [testRoute2, testRoute1, testRoute3];
const routes = [testRoute1, testRoute2, testRoute3];
const expectedHrefs = ['/', '/some-other-path', '/some-other-path-similar'];
const rendered = await renderInTestApp(<RoutedTabs routes={routes} />);
const tabs = rendered.queryAllByRole('tab');
for (const [k, v] of Object.entries(tabs)) {
expect(v.tagName).toBe('A');
expect(v).toHaveAttribute('href', routes[Number(k)].path);
expect(v).toHaveAttribute('href', expectedHrefs[Number(k)]);
}
});
});
@@ -79,9 +79,9 @@ export function RoutedTabs(props: { routes: SubRoute[] }) {
id: path,
label: title,
tabProps: {
...tabProps,
component: Link,
to,
...tabProps,
},
};
}),