@oslokommune/punkt-react 19.15.4 → 19.15.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/punkt-react.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oslokommune/punkt-react",
|
|
3
|
-
"version": "19.15.
|
|
3
|
+
"version": "19.15.5",
|
|
4
4
|
"description": "React komponentbibliotek til Punkt, designsystem for Oslo kommune",
|
|
5
5
|
"homepage": "https://punkt.oslo.kommune.no",
|
|
6
6
|
"author": "Team Designsystem, Oslo kommune",
|
|
@@ -101,5 +101,5 @@
|
|
|
101
101
|
"url": "https://github.com/oslokommune/punkt/issues"
|
|
102
102
|
},
|
|
103
103
|
"license": "MIT",
|
|
104
|
-
"gitHead": "
|
|
104
|
+
"gitHead": "0baab53f4a1bd33c07a73d24eacbd66087c98738"
|
|
105
105
|
}
|
|
@@ -56,6 +56,20 @@ describe('PktBreadcrumbs Component', () => {
|
|
|
56
56
|
expect(getAllByText('Item')).toBeTruthy()
|
|
57
57
|
})
|
|
58
58
|
|
|
59
|
+
it('renders a single crumb without a back link', () => {
|
|
60
|
+
const { container, getByText } = render(<PktBreadcrumbs breadcrumbs={breadcrumbs.slice(0, 1)} />)
|
|
61
|
+
|
|
62
|
+
expect(getByText('Home').closest('[aria-current="true"]')).toBeInTheDocument()
|
|
63
|
+
expect(container.querySelector('.pkt-breadcrumbs--mobile')).not.toBeInTheDocument()
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
it('renders an empty trail without a back link', () => {
|
|
67
|
+
const { container } = render(<PktBreadcrumbs breadcrumbs={[]} />)
|
|
68
|
+
|
|
69
|
+
expect(container.querySelector('.pkt-breadcrumbs__item')).not.toBeInTheDocument()
|
|
70
|
+
expect(container.querySelector('.pkt-breadcrumbs--mobile')).not.toBeInTheDocument()
|
|
71
|
+
})
|
|
72
|
+
|
|
59
73
|
it('renders with no wcag errors with axe', async () => {
|
|
60
74
|
const { container } = render(<PktBreadcrumbs breadcrumbs={breadcrumbs} navigationType="anchor" />)
|
|
61
75
|
const results = await axe(container)
|
|
@@ -78,21 +78,22 @@ export const PktBreadcrumbs = forwardRef(
|
|
|
78
78
|
))}
|
|
79
79
|
</ol>
|
|
80
80
|
|
|
81
|
-
{
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
81
|
+
{backLink &&
|
|
82
|
+
linkRenderer({
|
|
83
|
+
href: backLink.href,
|
|
84
|
+
className: 'pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile',
|
|
85
|
+
children: (
|
|
86
|
+
<>
|
|
87
|
+
<PktIcon
|
|
88
|
+
className="pkt-back-link__icon pkt-icon pkt-link__icon"
|
|
89
|
+
name="chevron-thin-left"
|
|
90
|
+
aria-hidden="true"
|
|
91
|
+
/>
|
|
92
|
+
<span className="pkt-breadcrumbs__text">{backLink.text}</span>
|
|
93
|
+
</>
|
|
94
|
+
),
|
|
95
|
+
props,
|
|
96
|
+
})}
|
|
96
97
|
</nav>
|
|
97
98
|
)
|
|
98
99
|
},
|