@@ -5,10 +5,10 @@ import '@testing-library/jest-dom'
5
5
6
6
describe ( 'Alert' , ( ) => {
7
7
it ( 'renders' , ( ) => {
8
- const { container } = render ( < Alert headingLevel = { 2 } /> )
8
+ const { container } = render ( < Alert heading = "Let op!" headingLevel = { 2 } /> )
9
9
10
10
const component = container . querySelector ( ':only-child' )
11
- const icon = component ?. querySelector ( '.ams-alert__icon ' )
11
+ const icon = component ?. querySelector ( '.ams-alert__severity-indicator > .ams-icon ' )
12
12
13
13
expect ( component ) . toBeInTheDocument ( )
14
14
expect ( component ) . toBeVisible ( )
@@ -17,15 +17,15 @@ describe('Alert', () => {
17
17
} )
18
18
19
19
it ( 'renders a design system BEM class name' , ( ) => {
20
- const { container } = render ( < Alert headingLevel = { 2 } /> )
20
+ const { container } = render ( < Alert heading = "Let op!" headingLevel = { 2 } /> )
21
21
22
22
const component = container . querySelector ( ':only-child' )
23
23
24
24
expect ( component ) . toHaveClass ( 'ams-alert' )
25
25
} )
26
26
27
27
it ( 'renders an additional class name' , ( ) => {
28
- const { container } = render ( < Alert className = "extra" headingLevel = { 2 } /> )
28
+ const { container } = render ( < Alert className = "extra" heading = "Let op!" headingLevel = { 2 } /> )
29
29
30
30
const component = container . querySelector ( ':only-child' )
31
31
@@ -35,7 +35,7 @@ describe('Alert', () => {
35
35
it ( 'supports ForwardRef in React' , ( ) => {
36
36
const ref = createRef < HTMLDivElement > ( )
37
37
38
- const { container } = render ( < Alert ref = { ref } headingLevel = { 2 } /> )
38
+ const { container } = render ( < Alert heading = "Let op!" headingLevel = { 2 } ref = { ref } /> )
39
39
40
40
const component = container . querySelector ( ':only-child' )
41
41
@@ -53,7 +53,7 @@ describe('Alert', () => {
53
53
} )
54
54
55
55
it ( 'renders the close button' , ( ) => {
56
- const { container } = render ( < Alert closeable = { true } headingLevel = { 2 } /> )
56
+ const { container } = render ( < Alert closeable heading = "Let op!" headingLevel = { 2 } /> )
57
57
58
58
const component = container . querySelector ( ':only-child' )
59
59
const closeButton = component ?. querySelector ( '.ams-icon-button' )
@@ -63,7 +63,7 @@ describe('Alert', () => {
63
63
} )
64
64
65
65
it ( 'renders the close button with a label' , ( ) => {
66
- render ( < Alert closeable = { true } closeButtonLabel = "Close" headingLevel = { 2 } /> )
66
+ render ( < Alert closeable closeButtonLabel = "Close" heading = "Let op! " headingLevel = { 2 } /> )
67
67
68
68
const closeButton = screen . getByRole ( 'button' , { name : 'Close' } )
69
69
@@ -72,7 +72,7 @@ describe('Alert', () => {
72
72
73
73
it ( 'fires the onClose event when the close button is clicked' , ( ) => {
74
74
const onClose = jest . fn ( )
75
- const { container } = render ( < Alert closeable = { true } onClose = { onClose } headingLevel = { 2 } /> )
75
+ const { container } = render ( < Alert closeable onClose = { onClose } heading = "Let op!" headingLevel = { 2 } /> )
76
76
77
77
const component = container . querySelector ( ':only-child' )
78
78
const closeButton = component ?. querySelector ( '.ams-icon-button' )
0 commit comments