diff --git a/application/modules/opac/views/scripts/panier/ajout-ajax-success.phtml b/application/modules/opac/views/scripts/panier/ajout-ajax-success.phtml index e106b99d9536de560ec5c1518ec8a0bf272a373c..f94a9c87f7f2066843740fc3b5ab78c4eb7100be 100644 --- a/application/modules/opac/views/scripts/panier/ajout-ajax-success.phtml +++ b/application/modules/opac/views/scripts/panier/ajout-ajax-success.phtml @@ -8,8 +8,9 @@ if($this->id_module){ $url_reload = $this->absoluteUrl(['controller' => 'modules-accueil', 'action' => 'render-module', 'id' => $this->id_module],null,true); - echo "<script>$('.boite.panier').reload('".$url_reload."');opacDialogClose();</script>"; + echo "<script>$('.boite.panier').reload('".$url_reload."');</script>"; } +echo "<script>opacDialogClose();<script>"; ?> <div class="ajout-result"><span><?php echo $this->_('La notice ').$this->notice->getTitrePrincipal().$this->_(' a bien été ajoutée au panier ').$this->panier->getLibelle(); ?></span> <a href="<?php echo $urlPanier;?>#panier_contenu"><?php echo $this->_('Voir le panier'); ?></a> diff --git a/tests/application/modules/opac/controllers/PanierControllerTest.php b/tests/application/modules/opac/controllers/PanierControllerTest.php index f168cc950dfa81365d42f75d4af5a2f90c585364..13eb18c1a66ae86ef3f57e831c10eeb43b8e6ab0 100644 --- a/tests/application/modules/opac/controllers/PanierControllerTest.php +++ b/tests/application/modules/opac/controllers/PanierControllerTest.php @@ -1218,10 +1218,10 @@ class PanierControllerAjoutAjaxSuccessTest extends PanierControllerSimpleLoggedU /** @test **/ - public function responseShouldContainsScriptBoitePanierReload() { + public function responseShouldContainsScriptOpacDialogClose() { $this->dispatch('/panier/ajout-ajax-success/id_notice/12/id_panier/39',true); $this->_json = json_decode($this->_response->getbody()); - $this->_xpath->assertXPath($this->_json->content,'//div[@class="ajout-result"]'); + $this->_xpath->assertXPathContentContains($this->_json->content,'//script','opacDialogClose()'); }