@@ -11,13 +11,13 @@ jest.unmock('react');
11
11
jest . unmock ( '@edx/frontend-platform/i18n' ) ;
12
12
13
13
jest . mock ( 'components/InfoPopover' , ( ) => ( { children } ) => (
14
- < div data-testid = "info-popover "> { children } </ div >
14
+ < div role = "tooltip "> { children } </ div >
15
15
) ) ;
16
16
17
17
describe ( '<CriterionContainer />' , ( ) => {
18
18
const props = {
19
- input : < div data-testid = "input" > input</ div > ,
20
- feedback : < div data-testid = "feedback" > feedback</ div > ,
19
+ input : < div > input</ div > ,
20
+ feedback : < div > feedback</ div > ,
21
21
criterion : {
22
22
name : 'criterionName' ,
23
23
description : 'description' ,
@@ -41,16 +41,14 @@ describe('<CriterionContainer />', () => {
41
41
42
42
expect ( screen . getByText ( 'criterionName' ) ) . toBeInTheDocument ( ) ;
43
43
44
- expect ( screen . getByTestId ( 'info-popover ') ) . toHaveTextContent ( 'description' ) ;
44
+ expect ( screen . getByRole ( 'tooltip ') ) . toHaveTextContent ( 'description' ) ;
45
45
46
46
expect ( screen . getByText ( 'Option 1' ) ) . toBeInTheDocument ( ) ;
47
47
expect ( screen . getByText ( 'description1' ) ) . toBeInTheDocument ( ) ;
48
48
expect ( screen . getByText ( 'Option 2' ) ) . toBeInTheDocument ( ) ;
49
49
expect ( screen . getByText ( 'description2' ) ) . toBeInTheDocument ( ) ;
50
50
51
- expect ( screen . getByTestId ( 'input' ) ) . toBeInTheDocument ( ) ;
52
51
expect ( screen . getByText ( 'input' ) ) . toBeInTheDocument ( ) ;
53
- expect ( screen . getByTestId ( 'feedback' ) ) . toBeInTheDocument ( ) ;
54
52
expect ( screen . getByText ( 'feedback' ) ) . toBeInTheDocument ( ) ;
55
53
} ) ;
56
54
@@ -59,11 +57,11 @@ describe('<CriterionContainer />', () => {
59
57
60
58
expect ( screen . getByText ( 'criterionName' ) ) . toBeInTheDocument ( ) ;
61
59
62
- expect ( screen . getByTestId ( 'info-popover ') ) . toHaveTextContent ( 'description' ) ;
60
+ expect ( screen . getByRole ( 'tooltip ') ) . toHaveTextContent ( 'description' ) ;
63
61
expect ( screen . getByText ( 'Option 1' ) ) . toBeInTheDocument ( ) ;
64
62
expect ( screen . getByText ( 'Option 2' ) ) . toBeInTheDocument ( ) ;
65
63
66
- expect ( screen . queryByTestId ( 'input' ) ) . not . toBeInTheDocument ( ) ;
67
- expect ( screen . queryByTestId ( 'feedback' ) ) . not . toBeInTheDocument ( ) ;
64
+ expect ( screen . queryByText ( 'input' ) ) . not . toBeInTheDocument ( ) ;
65
+ expect ( screen . queryByText ( 'feedback' ) ) . not . toBeInTheDocument ( ) ;
68
66
} ) ;
69
67
} ) ;
0 commit comments