Skip to content
Snippets Groups Projects
Commit 54c66a95 authored by Patrick Barroca's avatar Patrick Barroca :grin:
Browse files

hotline #115131 : bootstrap calendar defaults to legacy behaviour

parent 05f94e04
Branches
Tags
3 merge requests!3599Master,!3598Hotline,!3596hotline #115131 : bootstrap calendar defaults to legacy behaviour
Pipeline #10810 passed with stage
in 44 minutes and 55 seconds
- ticket #115131 : Magasin de thèmes : Par défaut la boîte agenda affiche les prochains évènements des prochains mois
\ No newline at end of file
......@@ -35,7 +35,7 @@ class Intonation_Library_Widget_Carousel_Agenda_View extends Intonation_Library_
protected function _findElements() {
$this->_initCalendar();
return $this->_calendar->getArticles($fill_with_following_months = false);
return $this->_calendar->getArticles();
}
......
......@@ -838,7 +838,7 @@ class TemplatesDispatchLibraryWidgetTest extends TemplatesIntonationTestCase {
class TemplatesDispatchAgendaWidgetTest extends TemplatesIntonationTestCase {
class TemplatesWidgetCalendarTest extends TemplatesIntonationTestCase {
protected $_vacances;
public function setUp() {
......@@ -851,29 +851,26 @@ class TemplatesDispatchAgendaWidgetTest extends TemplatesIntonationTestCase {
'preferences' => ['id_categorie' => 22]]]])
->assertSave();
ZendAfi_View_Helper_CalendarContent::setTimeSource(new TimeSourceForTest('2020-04-12 23:34:00'));
Intonation_View_CalendarContent::setTimeSource(new TimeSourceForTest('2020-04-12 23:34:00'));
$this->_vacances = $this->fixture('Class_Article',
['id' => 78,
'titre' => 'Les vacances',
'contenu' => 'À la mer']);
$this
->onLoaderOfModel('Class_Article')
->whenCalled('getAllArticles')
->answers([$this->_vacances]);
$this->onLoaderOfModel('Class_Article');
}
/** @test */
public function editAgendaWidgetInputTitreTypeShouldBeText() {
public function editWidgetShouldContainTitreTextInput() {
$this->dispatch('/admin/widget/edit-widget/id/21/id_profil/72', true);
$this->assertXpath('//input[@name="titre"][@type="text"]');
}
/** @test */
public function boiteAgendaShouldBePresent() {
public function calendarWithoutFiltersShouldBePresentAndQueryAllFuturEvents() {
Class_Article::getLoader()
->whenCalled('getArticlesByPreferences')
->with(['display_order' => 'EventDebut',
......@@ -898,6 +895,20 @@ class TemplatesDispatchAgendaWidgetTest extends TemplatesIntonationTestCase {
'event_end_after' => '2020-04-12'])
->answers([$this->_vacances])
->whenCalled('getArticlesByPreferences')
->with(['display_order' => 'EventDebut',
'id_categorie' => '22',
'events_only' => true,
'event_date' => '',
'id_bib' => 0,
'id_lieu' => '',
'custom_fields' => [],
'published' => true,
'event_start_after' => '2020-04',
'event_end_after' => '',
'limit' => 9])
->answers([$this->_vacances])
->beStrict();
$this->dispatch('/opac/index/index/id_profil/72');
......@@ -906,7 +917,7 @@ class TemplatesDispatchAgendaWidgetTest extends TemplatesIntonationTestCase {
/** @test */
public function cmsCalendarShouldRenderFilters() {
public function ajaxCmsCalendarActionShouldRenderFilters() {
$this->dispatch('/opac/cms/calendar/id_profil/72/id_module/21/render/ajax');
$this->assertXPathContentContains('//div[contains(@class, "filters")]//a[contains(@href, "/cms/calendar/")]',
'Janvier');
......@@ -914,7 +925,7 @@ class TemplatesDispatchAgendaWidgetTest extends TemplatesIntonationTestCase {
/** @test */
public function cmsCalendarShouldRenderSelectedDayInFilterTitle() {
public function ajaxCmsCalendarActionWithDayShouldRenderItInFilters() {
$this->dispatch('/opac/cms/calendar/id_profil/72/id_module/21/day/2019-06-01/render/ajax');
$this->assertXPathContentContains('//div[contains(@class, "filters")]//button/span',
'01/06/2019');
......@@ -922,7 +933,7 @@ class TemplatesDispatchAgendaWidgetTest extends TemplatesIntonationTestCase {
/** @test */
public function cmsCalendarShouldRenderSelectedMonthInFilterTitle() {
public function ajaxCmsCalendarActionWithMonthShouldRenderItInFilters() {
$this->dispatch('/opac/cms/calendar/id_profil/72/id_module/21/day/2019-06/render/ajax', true);
$this->assertXPathContentContains('//div[contains(@class, "filters")]//button/span',
'06/2019');
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment