@oslokommune/punkt-react 12.41.1 → 12.42.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oslokommune/punkt-react",
3
- "version": "12.41.1",
3
+ "version": "12.42.1",
4
4
  "description": "React komponentbibliotek til Punkt, et designsystem laget av Oslo Origo",
5
5
  "homepage": "https://punkt.oslo.kommune.no",
6
6
  "author": "Team Designsystem, Oslo Origo",
@@ -38,7 +38,7 @@
38
38
  "dependencies": {
39
39
  "@lit-labs/ssr-dom-shim": "^1.2.1",
40
40
  "@lit/react": "^1.0.7",
41
- "@oslokommune/punkt-elements": "^12.41.1",
41
+ "@oslokommune/punkt-elements": "^12.42.1",
42
42
  "angular-html-parser": "^6.0.2",
43
43
  "html-format": "^1.1.7",
44
44
  "prettier": "^3.3.3",
@@ -49,7 +49,7 @@
49
49
  "devDependencies": {
50
50
  "@babel/plugin-proposal-private-property-in-object": "^7.18.6",
51
51
  "@oslokommune/punkt-assets": "^12.39.2",
52
- "@oslokommune/punkt-css": "^12.41.0",
52
+ "@oslokommune/punkt-css": "^12.42.1",
53
53
  "@testing-library/jest-dom": "^6.5.0",
54
54
  "@testing-library/react": "^16.0.1",
55
55
  "@testing-library/user-event": "^14.5.2",
@@ -112,5 +112,5 @@
112
112
  "url": "https://github.com/oslokommune/punkt/issues"
113
113
  },
114
114
  "license": "MIT",
115
- "gitHead": "6af0ba1d43d2ba724a15b4d37c80ab62a68c8cae"
115
+ "gitHead": "8c03898a29df70a7126869654f75662c626dfc90"
116
116
  }
@@ -33,6 +33,22 @@ describe('PktAlert', () => {
33
33
  expect(onClose).toHaveBeenCalledTimes(1)
34
34
  })
35
35
 
36
+ test('renders with default role', async () => {
37
+ const { getByRole } = render(<PktAlert>Alert text</PktAlert>)
38
+ await window.customElements.whenDefined('pkt-alert')
39
+ const alert = getByRole('status')
40
+ expect(alert).toBeInTheDocument()
41
+ expect(alert).toHaveAttribute('role', 'status')
42
+ })
43
+
44
+ test('renders with alert as role prop', async () => {
45
+ const { getByRole } = render(<PktAlert role="alert">Alert text</PktAlert>)
46
+ await window.customElements.whenDefined('pkt-alert')
47
+ const alert = getByRole('alert')
48
+ expect(alert).toBeInTheDocument()
49
+ expect(alert).toHaveAttribute('role', 'alert')
50
+ })
51
+
36
52
  describe('accessibility', () => {
37
53
  test('renders with no wcag errors with axe', async () => {
38
54
  const { container } = render(<PktAlert title="Error" skin="error"></PktAlert>)
@@ -12,6 +12,7 @@ export interface IPktAlert extends PktElType {
12
12
  date?: string
13
13
  ariaLive?: 'off' | 'polite' | 'assertive'
14
14
  compact?: boolean
15
+ role?: string
15
16
  onClose?: (e: CustomEvent) => void
16
17
  }
17
18