diff --git a/VERSIONS_HOTLINE/135592 b/VERSIONS_HOTLINE/135592 new file mode 100644 index 0000000000000000000000000000000000000000..68a7064668b6f307a0ac2deaf7c9cc12b1f5c56c --- /dev/null +++ b/VERSIONS_HOTLINE/135592 @@ -0,0 +1 @@ + - ticket #135592 : Magasin de thèmes : Correction de l'affichage du mode mur. \ No newline at end of file diff --git a/library/templates/Intonation/Library/Widget/Carousel/Agenda/View.php b/library/templates/Intonation/Library/Widget/Carousel/Agenda/View.php index ebf804cf696e223b59f7951c0e9f1897f3059840..adf31ab7928b9704cd3e79ae666e15e31efe8c7f 100644 --- a/library/templates/Intonation/Library/Widget/Carousel/Agenda/View.php +++ b/library/templates/Intonation/Library/Widget/Carousel/Agenda/View.php @@ -29,6 +29,7 @@ class Intonation_Library_Widget_Carousel_Agenda_View extends Intonation_Library_ protected function _renderHeadScriptsOn($script_loader) { $script_loader->addOPACScript('calendrier'); + parent::_renderHeadScriptsOn($script_loader); return $this; } diff --git a/tests/scenarios/Templates/TemplatesAgendaTest.php b/tests/scenarios/Templates/TemplatesAgendaTest.php index edc920bf05ea9a7d9324b10a820cbf447c0bf933..7e402aebd94fcbfc2e3e7da186fdb95076b1d779 100644 --- a/tests/scenarios/Templates/TemplatesAgendaTest.php +++ b/tests/scenarios/Templates/TemplatesAgendaTest.php @@ -140,3 +140,63 @@ class TemplatesAgendaWidgetWithSessionActivityAndRightRegisterTest 'Nouvelle inscription'); } } + + + + + +class TemplatesAgendaWallModeTestCase extends AbstractControllerTestCase { + public function setUp() { + parent::setUp(); + + ZendAfi_Auth::getInstance()->clearIdentity(); + + $this->_buildTemplateProfil(['id' => 78]); + + $profile_patcher = (new Class_Template_ProfilePatcher(null)) + ->setProfile(Class_Profil::getCurrentProfil()); + + $profile_patcher + ->addWidget(Intonation_Library_Widget_Carousel_Agenda_Definition::CODE, + Class_Profil::DIV_MAIN, + ['rendering' => 'card-description', + 'layout' => 'wall', + 'size' => 1, + 'description_length' => 4]); + + $this + ->onLoaderOfModel(Class_Article::class) + ->whenCalled('getArticlesByPreferences') + ->answers([$this->fixture(Class_Article::class, + ['id' => 7, + 'titre' => 'Parlez-vous français ?', + 'description' => 'La description s\'arrête ici et pas plus loin.', + 'contenu' => '<p>Une b...</p>', + 'categorie' => $this->fixture(Class_ArticleCategorie::class, + ['id' => 3, + 'libelle' => 'Animations langues']) + ]) + ]); + + $this->dispatch('/opac/widget/render/widget_id/1/profile_id/78'); + } + + + /** @test */ + public function masonryJsShouldBeCall() { + $this->assertXPathContentContains('//script', '$(function(){$("#1").parent().masonry();});'); + } + + + /** @test */ + public function masonryShouldBeLoaded() { + $this->assertXPath('//head/script[contains(@src, "/masonry.js")]'); + } + + + /** @test */ + public function descriptionShouldBeTruncate() { + $this->assertXPathContentContains('//div[contains(@class, "calendar widget")]//p[contains(@class, "model_description")]', + 'La description s\'arrête ici …'); + } +}