diff --git a/config/schema/facets.widgets.schema.yml b/config/schema/facets.widgets.schema.yml index 5e960b3..e230db8 100644 --- a/config/schema/facets.widgets.schema.yml +++ b/config/schema/facets.widgets.schema.yml @@ -38,19 +38,3 @@ facet.widget.config.links: # "soft limit" and "show counts". facet.widget.config.checkbox: type: facet.widget.config.links - -# Config schema for datebasic, you can find the implementation in -# Drupal\facets\Plugin\facets\widget\DateBasicWidget. -facet.widget.config.datebasic: - type: facet.widget.default_config - label: 'List of dates configuration' - mapping: - display_relative: - type: boolean - label: 'Display relative' - granularity: - type: integer - label: 'Granularity' - date_display: - type: string - label: 'Date display' diff --git a/tests/src/Functional/IntegrationTest.php b/tests/src/Functional/IntegrationTest.php index 89527e6..3e6e7d4 100644 --- a/tests/src/Functional/IntegrationTest.php +++ b/tests/src/Functional/IntegrationTest.php @@ -472,41 +472,40 @@ public function testExcludeFacetDate() { $this->indexItems($this->indexId); - $facet_name = "Created"; $facet_id = "created"; // Create facet. $facet_edit_page = 'admin/config/search/facets/' . $facet_id . '/edit'; - $this->createFacet($facet_name, $facet_id, $field_name); + $this->createFacet("Created", $facet_id, $field_name); $form = [ - 'widget' => 'datebasic', - 'widget_config[granularity]' => SearchApiDate::FACETAPI_DATE_MONTH, - 'widget_config[display_relative]' => 0, + 'widget' => 'links', + 'facet_settings[date_item][status]' => TRUE, + 'facet_settings[date_item][settings][display_relative]' => FALSE, + 'facet_settings[date_item][settings][granularity]' => SearchApiDate::FACETAPI_DATE_MONTH, ]; $this->drupalGet($facet_edit_page); - $this->drupalPostForm(NULL, ['widget' => 'datebasic'], 'Configure widget'); $this->drupalPostForm(NULL, $form, 'Save'); $this->drupalGet('search-api-test-fulltext'); - $this->assertText('foo old'); - $this->assertText('foo new'); - $this->clickLink('March 2017'); - $this->checkFacetIsActive('March 2017'); - $this->assertText('foo new'); - $this->assertNoText('foo old'); + $this->assertSession()->pageTextContains('foo old'); + $this->assertSession()->pageTextContains('foo new'); + $this->clickLink('1490000000'); + $this->checkFacetIsActive('1490000000'); + $this->assertSession()->pageTextContains('foo new'); + $this->assertSession()->pageTextNotContains('foo old'); $this->drupalGet($facet_edit_page); - $this->assertNoFieldChecked('edit-facet-settings-exclude'); + $this->assertSession()->checkboxNotChecked('edit-facet-settings-exclude'); $form['facet_settings[exclude]'] = TRUE; $this->drupalPostForm(NULL, $form, 'Save'); - $this->assertFieldChecked('edit-facet-settings-exclude'); + $this->assertSession()->checkboxChecked('edit-facet-settings-exclude'); $this->drupalGet('search-api-test-fulltext'); - $this->clickLink('March 2017'); - $this->checkFacetIsActive('March 2017'); - $this->assertText('foo old'); - $this->assertNoText('foo new'); + $this->clickLink('1490000000'); + $this->checkFacetIsActive('1490000000'); + $this->assertSession()->pageTextContains('foo old'); + $this->assertSession()->pageTextNotContains('foo new'); } /**