-
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.
Revert fix/slug-to-classname (#32742)
Co-authored-by: Bernie Reiter <[email protected]>
- Loading branch information
Showing
6 changed files
with
53 additions
and
27 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
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
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
32 changes: 32 additions & 0 deletions
32
packages/block-editor/src/components/font-sizes/test/utils.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { logged } from '@wordpress/deprecated'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import { getFontSizeClass } from '../utils'; | ||
|
||
describe( 'getFontSizeClass()', () => { | ||
afterEach( () => { | ||
for ( const key in logged ) { | ||
delete logged[ key ]; | ||
} | ||
} ); | ||
|
||
it( 'Should return the correct font size class when given a string', () => { | ||
const fontSizeClass = getFontSizeClass( '14px' ); | ||
expect( fontSizeClass ).toBe( 'has-14-px-font-size' ); | ||
} ); | ||
|
||
it( 'Should return the correct font size class when given a number', () => { | ||
const fontSizeClass = getFontSizeClass( 16 ); | ||
expect( fontSizeClass ).toBe( 'has-16-font-size' ); | ||
} ); | ||
|
||
it( 'Should return the correct font size class when the given font size contains special characters', () => { | ||
const fontSizeClass = getFontSizeClass( '#abcdef' ); | ||
expect( fontSizeClass ).toBe( 'has-abcdef-font-size' ); | ||
} ); | ||
} ); |
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
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