1
1
import { render } from '@1024pix/ember-testing-library' ;
2
- import { click } from '@ember/test-helpers' ;
3
2
import { hbs } from 'ember-cli-htmlbars' ;
4
3
import { module , test } from 'qunit' ;
5
- import sinon from 'sinon' ;
6
4
7
5
import setupIntlRenderingTest from '../../../helpers/setup-intl-rendering' ;
8
6
@@ -13,43 +11,17 @@ module('Integration | Component | Certification Banners | Congratulations Certif
13
11
// given
14
12
const store = this . owner . lookup ( 'service:store' ) ;
15
13
this . set ( 'fullName' , 'Fifi Brindacier' ) ;
16
- this . set ( 'closeBanner' , ( ) => { } ) ;
17
14
this . set ( 'certificationEligibility' , store . createRecord ( 'is-certifiable' , { } ) ) ;
18
15
19
16
// when
20
17
const screen = await render (
21
18
hbs `<CertificationBanners::CongratulationsCertificationBanner
22
19
@fullName={{this.fullName}}
23
- @closeBanner={{this.closeBanner}}
24
20
@certificationEligibility={{this.certificationEligibility}}
25
21
/>` ,
26
22
) ;
27
23
28
24
// then
29
25
assert . ok ( screen . getByText ( 'Bravo Fifi Brindacier, votre profil Pix est certifiable.' ) ) ;
30
26
} ) ;
31
-
32
- test ( 'calls the closeBanner method when closing the banner' , async function ( assert ) {
33
- // given
34
- const store = this . owner . lookup ( 'service:store' ) ;
35
- const closeBannerStub = sinon . stub ( ) ;
36
- this . set ( 'closeBanner' , closeBannerStub ) ;
37
- this . set ( 'fullName' , 'Fifi Brindacier' ) ;
38
- this . set ( 'certificationEligibility' , store . createRecord ( 'is-certifiable' , { } ) ) ;
39
-
40
- const screen = await render (
41
- hbs `<CertificationBanners::CongratulationsCertificationBanner
42
- @fullName={{this.fullName}}
43
- @closeBanner={{this.closeBanner}}
44
- @certificationEligibility={{this.certificationEligibility}}
45
- />` ,
46
- ) ;
47
-
48
- // when
49
- await click ( screen . getByRole ( 'button' , { name : 'Fermer' } ) ) ;
50
-
51
- // then
52
- sinon . assert . calledOnce ( closeBannerStub ) ;
53
- assert . ok ( true ) ;
54
- } ) ;
55
27
} ) ;
0 commit comments