1
1
import { render } from '@1024pix/ember-testing-library' ;
2
2
import { click } from '@ember/test-helpers' ;
3
3
import { hbs } from 'ember-cli-htmlbars' ;
4
+ import { t } from 'ember-intl/test-support' ;
4
5
import { module , test } from 'qunit' ;
5
6
6
7
import setupIntlRenderingTest from '../../../../helpers/setup-intl-rendering' ;
@@ -58,7 +59,7 @@ module('Integration | Component | Campaign::Analysis::TubeRecommendationRow', fu
58
59
) ;
59
60
60
61
// when
61
- await click ( '[data-icon="chevron-down"]' ) ;
62
+ await click ( screen . getByLabelText ( t ( 'pages.campaign-review.table.analysis.column.tutorial.aria-label' ) ) ) ;
62
63
63
64
// then
64
65
assert . dom ( 'tr[aria-hidden="false"]' ) . containsText ( '1 tuto recommandé par la communauté Pix' ) ;
@@ -93,10 +94,12 @@ module('Integration | Component | Campaign::Analysis::TubeRecommendationRow', fu
93
94
// given
94
95
this . tubeRecommendation . tutorials = [ tutorial1 , tutorial2 ] ;
95
96
96
- await render ( hbs `<Campaign::Analysis::TubeRecommendationRow @tubeRecommendation={{this.tubeRecommendation}} />` ) ;
97
+ const screen = await render (
98
+ hbs `<Campaign::Analysis::TubeRecommendationRow @tubeRecommendation={{this.tubeRecommendation}} />` ,
99
+ ) ;
97
100
98
101
// when
99
- await click ( '[data-icon="chevron-down"]' ) ;
102
+ await click ( screen . getByLabelText ( t ( 'pages.campaign-review.table.analysis.column.tutorial.aria-label' ) ) ) ;
100
103
101
104
// then
102
105
assert . dom ( '[aria-hidden="false"]' ) . containsText ( '2 tutos recommandés par la communauté Pix' ) ;
@@ -106,11 +109,13 @@ module('Integration | Component | Campaign::Analysis::TubeRecommendationRow', fu
106
109
// given
107
110
this . tubeRecommendation . tutorials = [ tutorial1 , tutorial2 ] ;
108
111
109
- await render ( hbs `<Campaign::Analysis::TubeRecommendationRow @tubeRecommendation={{this.tubeRecommendation}} />` ) ;
110
- await click ( '[data-icon="chevron-down"]' ) ;
112
+ const screen = await render (
113
+ hbs `<Campaign::Analysis::TubeRecommendationRow @tubeRecommendation={{this.tubeRecommendation}} />` ,
114
+ ) ;
115
+ await click ( screen . getByLabelText ( t ( 'pages.campaign-review.table.analysis.column.tutorial.aria-label' ) ) ) ;
111
116
112
117
// when
113
- await click ( '[data-icon="chevron-up"]' ) ;
118
+ await click ( screen . getByLabelText ( t ( 'pages.campaign-review.table.analysis.column.tutorial.aria-label' ) ) ) ;
114
119
115
120
// then
116
121
assert . dom ( '[aria-hidden="false"]' ) . doesNotExist ( ) ;
0 commit comments