Skip to content

Commit

Permalink
Merge pull request #2 from digitalutsc/d10
Browse files Browse the repository at this point in the history
d10 tests update
  • Loading branch information
kylehuynh205 authored Oct 30, 2023
2 parents c54c8fe + b78e8d6 commit e1e4519
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
5 changes: 5 additions & 0 deletions schema/facets_year_range.schema.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Config schema for date range, you can find the implementation in
# Drupal\facets_year_range\Plugin\facets\widget\DateRangeWidget.
facet.widget.config.year_range:
type: facet.widget.default_config
label: 'Year Range widget configuration'
18 changes: 9 additions & 9 deletions tests/src/Functional/YearRangeIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,31 +97,31 @@ public function testSliderWidget(): void {
'widget' => 'year_range',
'facet_settings[year_range][status]' => TRUE,
], 'Save');

$this->assertSession()->checkboxChecked('edit-facet-settings-year-range-status');

$this->drupalGet('search-api-test-fulltext');
$this->assertFacetBlocksAppear();
$this->assertSession()->pageTextContains('Displaying 15 search results');
$this->assertSession()->pageTextContainsOnce('Displaying 15 search results');

$url = Url::fromUserInput('/search-api-test-fulltext', ['query' => ['f[0]' => 'created:(min:1614384000,max:1620864000)']]);
$this->drupalGet($url->setAbsolute()->toString());

$this->assertSession()->pageTextContains('foo date 4');
$this->assertSession()->pageTextContains('foo date 1');
$this->assertSession()->pageTextContains('foo date 2');
$this->assertSession()->pageTextContains('foo date 3');
$this->assertSession()->pageTextContains('Displaying 4 search results');
$this->assertSession()->pageTextContainsOnce('foo date 4');
$this->assertSession()->pageTextContainsOnce('foo date 1');
$this->assertSession()->pageTextContainsOnce('foo date 2');
$this->assertSession()->pageTextContainsOnce('foo date 3');
$this->assertSession()->pageTextContainsOnce('Displaying 4 search results');

$url = Url::fromUserInput('/search-api-test-fulltext', ['query' => ['f[0]' => 'daterange:(min:,max:1641225702)']]);
$this->drupalGet($url->setAbsolute()->toString());

$this->assertSession()->pageTextContains('Displaying 15 search results');
$this->assertSession()->pageTextContainsOnce('Displaying 15 search results');

$url = Url::fromUserInput('/search-api-test-fulltext', ['query' => ['f[0]' => 'daterange:(min:,max:)']]);
$this->drupalGet($url->setAbsolute()->toString());

$this->assertSession()->pageTextContains('Displaying 15 search results');
$this->assertSession()->pageTextContainsOnce('Displaying 15 search results');
}

}

0 comments on commit e1e4519

Please sign in to comment.