-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Font Appearance Control: Refactor font appearance fallbacks (#63215)
* Refactor font appearance fallbacks * Create new findNearestStyleAndWeight function * Add tests for findNearestStyleAndWeight * Refactor findNearestStyleAndWeight * Add a test for normal/100 * Add comments * Tidy up comments * Fix test description * Update test descriptions * Update deps and wrap setFontAppearance and resetFontAppearance in useCallback * Add e2e test for appearance control dropdown menu * Add periods to end of comments * Use better test data for font appearance e2e default test * Add findNearestFontStyle function with tests * Limit the dependency array to just fontFamily * Add normal font style test * Add invalid font style test * Try toHaveText instead of toContainText * Try using TT4 for e2e test rather than TT3 * Use combobox role rather than button in e2e test * Set nearestFontStyle to an empty string by default * Refactor findNearestFontStyle * Do not activate a theme in font appearance e2e test * Run findNearestStyleAndWeight only when fontFamily has changed * Only trigger appearance onChange if values are different Co-authored-by: mikachan <mikachan@git.wordpress.org> Co-authored-by: talldan <talldanwp@git.wordpress.org> Co-authored-by: creativecoder <grantmkin@git.wordpress.org> Co-authored-by: noisysocks <noisysocks@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
- Loading branch information
1 parent
0b8e0b5
commit afb24fc
Showing
4 changed files
with
554 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.