diff --git a/classes/help-text.css b/classes/help-text.css index a8a246a3..7331bb9f 100644 --- a/classes/help-text.css +++ b/classes/help-text.css @@ -1,4 +1,5 @@ .help-text { + color: #AAA; font-size: smaller; padding: var(--text-padding-sm); } \ No newline at end of file diff --git a/data/Database.js b/data/Database.js index d7c2ba00..9800bb2c 100644 --- a/data/Database.js +++ b/data/Database.js @@ -16,7 +16,7 @@ export default class Database { } search(query) { - return this.components.filter(({ form }) => form.includes(query)) + return this.components.filter(({ definition, form }) => form.includes(query) || definition.includes(query)) } } diff --git a/pages/Search/Search.css b/pages/Search/Search.css index 692344e4..2bf6f218 100644 --- a/pages/Search/Search.css +++ b/pages/Search/Search.css @@ -26,7 +26,6 @@ .results { - inline-size: max(max-content, 100%); margin: 0; margin-inline: auto; @@ -52,8 +51,9 @@ } search { - align-self: center; - margin: 1em; + align-self: center; + margin: 1em; + max-inline-size: 30em; } .search-controls { diff --git a/pages/Search/Search.hbs b/pages/Search/Search.hbs index 0ed8d16d..64d6edc1 100644 --- a/pages/Search/Search.hbs +++ b/pages/Search/Search.hbs @@ -18,7 +18,7 @@ > - Searches components (in any orthography) and definitions. + Searches components (in any orthography) and definitions for exact matches anywhere within the string. Leave blank and press "Search" to display all components. diff --git a/pages/Search/Search.test.js b/pages/Search/Search.test.js index 6e85be63..7b23d95f 100644 --- a/pages/Search/Search.test.js +++ b/pages/Search/Search.test.js @@ -38,7 +38,12 @@ describe(`Search`, function() { it(`Forms (Source)`) - it(`Definition (Project)`) + it.only(`Definition (Project)`, function() { + cy.visit(`/search`) + cy.get(`#search-box`).type(`think`) + cy.get(`form`).submit() + cy.get(`.results tbody tr`).should(`have.length`, 1) + }) it(`Definitions (Source)`)