canvas-lms/jest
Charley Kline 0c21111e77 Make type filter searchable on courses main list
Closes USERS-515
flag=none

This makes the "Filter by term" select box on the main courses
page searchable by typing into the box to narrow down the
choices. Similar functionality is already present in the
corresponding selections in the New Course modal.

Because this selection dropdown includes groups, it necessitated
a complete rewrite of the SearchableSelect component so that it
works a little more like CanvasSelect in handling its children.
It no longer depends on CanvasAsyncSelect.

SearchableSelect was almost completely rewritten from scratch so
I would recommend just reviewing the new module an ignoring the
diff from the old one. Hopefully it is more generally useful now
like CanvasSelect is.

In the course of writing tests for this, I discovered that all
our supported browsers implement Array.prototype.flat(), so it
is safe to use. What does NOT implement it, however is Jest 🤦
so I also implemented them as polyfills in the jest-setup.js
and now everyone can use them in the future.

Test plan:
* Have a bunch of terms
* Go to /accounts/default
* Click on "Filter by term" to bring up the selection dropdown
* It should work just like it used to to filter the courses list
* Now try typing in the box... it should filter the available
  selections in the dropdown while you type
* If no terms match what you're typing, the dropdown should go
  away altogether and the select box itself should get a red
  highlight with red error text
* A11y should be okay

Change-Id: I3da8dd681645f83f858996fe42030ad400eada01
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/237585
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Matt Meservey
QA-Review: August Thornton <august@instructure.com>
2020-05-19 01:24:11 +00:00
..
coffeeTransformer.js Upgrade to babel 7 & allow any js file to be themeable 2019-04-02 14:59:20 +00:00
handlebarsTransformer.js spec: fix handlebars transform for jest tests 2019-09-05 15:03:54 +00:00
i18nTransformer.js Remove add-module-exports babel plugin & use esModules 2019-05-03 22:49:58 +00:00
imageMock.js Make core translations and svg imports available in jest 2018-11-29 16:09:47 +00:00
jest-setup.js Make type filter searchable on courses main list 2020-05-19 01:24:11 +00:00