@@ -239,6 +239,7 @@ module('Integration | Component | organizations/information-section-view', funct
239
239
assert .dom (screen .getByText (' Archivée le 22/02/2022 par Rob Lochon.' )).exists ();
240
240
});
241
241
});
242
+
242
243
module (' when organization is parent' , function () {
243
244
test (' it should display parent label' , async function (assert ) {
244
245
// given
@@ -457,6 +458,52 @@ module('Integration | Component | organizations/information-section-view', funct
457
458
});
458
459
});
459
460
});
461
+
462
+ module (' Net Promoter Score' , function () {
463
+ module (' when NPS is enabled' , function () {
464
+ test (' should display a link to formNPSUrl' , async function (assert ) {
465
+ // given
466
+ const NPSUrl = ' http://example.net' ;
467
+ const organization = EmberObject .create ({
468
+ features: {
469
+ SHOW_NPS : { active: true , params: { formNPSUrl: NPSUrl } },
470
+ },
471
+ });
472
+
473
+ // when
474
+ const screen = await render (<template ><InformationSectionView @ organization ={{organization }} /></template >);
475
+
476
+ // then
477
+ assert .ok (
478
+ screen .getByText (` ${ t (' components.organizations.information-section-view.features.SHOW_NPS' )} :` ),
479
+ );
480
+ assert .ok (screen .getByRole (' link' , { name: NPSUrl }));
481
+ });
482
+ });
483
+
484
+ module (' when NPS is not enabled' , function () {
485
+ test (' should display text with no and not the link' , async function (assert ) {
486
+ // given
487
+ const NPSUrl = ' http://example.net' ;
488
+ const organization = EmberObject .create ({
489
+ features: {
490
+ SHOW_NPS : { active: false , params: { formNPSUrl: NPSUrl } },
491
+ },
492
+ });
493
+
494
+ // when
495
+ const screen = await render (<template ><InformationSectionView @ organization ={{organization }} /></template >);
496
+
497
+ // then
498
+ assert .ok (
499
+ screen .getByText (
500
+ ` ${ t (' components.organizations.information-section-view.features.SHOW_NPS' )} : ${ t (' common.words.no' )} ` ,
501
+ ),
502
+ );
503
+ assert .notOk (screen .queryByRole (' link' , { name: NPSUrl }));
504
+ });
505
+ });
506
+ });
460
507
});
461
508
});
462
509
0 commit comments