- Issue created by @shalini_jha
- Merge request !643Issue #3493778:Format plural for number of search Results → (Merged) created by shalini_jha
- 🇮🇳India shalini_jha
I have addressed the issue with the search result count by correcting the grammar for displaying "1 Result" when there is only one result. Additionally, I have added a test to verify this change. I am moving this to "Needs Review." Please review the changes and let me know if they are appropriate or if any further modifications are needed.
Currently, when no results are found, it displays "0 Results." Do we still need this text, given that "No modules found" is already displayed?
- 🇺🇸United States chrisfromredfin Portland, Maine
Good work so far, but we need to make this its own test. I think you could start with the test you injected this into and copy/paste as a starting point, but then you need to do a search that gets only one result.
Here's some completely untested code to get you started:
/** * Tests formatting plural for results. */ public function testSearchForSpecialChar(): void { // Load browser. $this->drupalGet('admin/modules/browse'); // Check for plural. $this->svelteInitHelper('text', '10 Results'); // Tests for the presence of search bar placeholder text. $search_field = $this->getSession()->getPage()->find('css', '#pb-text'); // Fill in the search field. $this->inputSearchField('', TRUE); $this->inputSearchField('Vitamin', TRUE); $this->assertSession()->waitForElementVisible('css', ".search__search-submit")->click(); // Test for result count text (singular). $this->assertEquals('1 Result', $this->getElementText('.pb-search-results')); }
- 🇮🇳India shalini_jha
Thank you for the review. I have added separate test coverage for this functionality and verified that it is working as expected. Moving this for review . Please review
- 🇮🇳India shalini_jha
shalini_jha → changed the visibility of the branch 3492153-project-usage-icon to hidden.
- First commit to issue fork.
- 🇺🇸United States phenaproxima Massachusetts
Fixed merge conflicts and a couple minor things with the tests. This looks okay to me, so let's run with it.
-
chrisfromredfin →
committed c26d77d2 on 2.0.x authored by
shalini_jha →
Issue #3493778: Format plural for number of search results
-
chrisfromredfin →
committed c26d77d2 on 2.0.x authored by
shalini_jha →
Automatically closed - issue fixed for 2 weeks with no activity.