@wordpress/components
Version:
UI components for WordPress.
16 lines (14 loc) • 596 B
JavaScript
/**
* Internal dependencies
*/
import { normalizeTextString } from '../strings';
describe( 'normalizeTextString', () => {
it( 'should normalize hyphen-like characters to hyphens', () => {
expect( normalizeTextString( 'foo~bar' ) ).toBe( 'foo-bar' );
expect( normalizeTextString( 'foo־bar' ) ).toBe( 'foo-bar' );
expect( normalizeTextString( 'foo‐bar' ) ).toBe( 'foo-bar' );
expect( normalizeTextString( 'foo⸻bar' ) ).toBe( 'foo-bar' );
expect( normalizeTextString( 'foo゠bar' ) ).toBe( 'foo-bar' );
expect( normalizeTextString( 'foo-bar' ) ).toBe( 'foo-bar' );
} );
} );