File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed
client/modules/IDE/components Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change
1
+ import React from 'react' ;
2
+
3
+ import { render , screen } from '../../../test-utils' ;
4
+
5
+ import EditorAccessibility from './EditorAccessibility' ;
6
+
7
+ describe ( '<EditorAccessibility />' , ( ) => {
8
+ it ( 'renders empty message with no lines' , ( ) => {
9
+ render ( < EditorAccessibility lintMessages = { [ ] } /> ) ;
10
+
11
+ expect (
12
+ screen . getByRole ( 'listitem' , {
13
+ description : 'There are no lint messages'
14
+ } )
15
+ ) . toBeInTheDocument ( ) ;
16
+ } ) ;
17
+
18
+ it ( 'renders lint message' , ( ) => {
19
+ render (
20
+ < EditorAccessibility
21
+ lintMessages = { [
22
+ {
23
+ severity : 'info' ,
24
+ line : '1' ,
25
+ message : 'foo' ,
26
+ id : '1a2b3c'
27
+ }
28
+ ] }
29
+ />
30
+ ) ;
31
+
32
+ expect (
33
+ screen . queryByText ( 'There are no lint messages' )
34
+ ) . not . toBeInTheDocument ( ) ;
35
+
36
+ const listItem = screen . getByRole ( 'listitem' ) ;
37
+ expect ( listItem ) . toBeInTheDocument ( ) ;
38
+ expect ( listItem . textContent ) . toEqual ( 'info in line1 :foo' ) ;
39
+ } ) ;
40
+ } ) ;
You can’t perform that action at this time.
0 commit comments