NCIOCPL / drug-dictionary-app

NCI Drug Dictionary Application
2 stars 0 forks source link

Change Autosuggest to stop appearing after 30 characters #90

Closed VictoriaSunNIH closed 3 years ago

VictoriaSunNIH commented 3 years ago

Issue description

Currently, autosuggest will continue to display its suggested options in the dropdown regardless of how many characters a user types. We would like autosuggest to stop displaying after the user has entered more than 30 characters. In a separate ticket, we will address what should happen to search if a user enters more than 30 characters (#89)

ESTIMATE TBD

What's the expected change?

Users are no longer allowed to enter more than 30 characters in the field, and we stop displaying matching autosuggest terms, and instead, display a warning message on the input field "Please enter up to 30 characters for your search.". Separately in the API, we will limit autosuggest to only return results under 30 characters

What's the current functionality?

Currently, users can enter as many characters as they want and autosuggest will continue to match

What's the updated acceptance criteria?

Scenario: User tries to type more than 30 characters 
Given user is typing in the search box for a starts with search
  When the user types more than 30 characters, the user is not able to enter anymore characters
Scenario: User tries to copy in more than 30 characters to the search box
Given user is tries to copy paste more than 30 characters into the search box 
  Then the system truncates the copied text to 30 characters
Scenario: Autosuggest appears after between 3 and 30 characters
Given user is typing in the search box for a contains or starts with search
  When the user types more than 3 characters
     And less than 30 characters
     Then autosuggest shows matches to the user's entered text and does not display the warning message

Additional details / screenshot

Related Tickets