UNPKG

@wordpress/editor

Version:
19 lines (15 loc) 493 B
/** * Internal dependencies */ import { cleanForSlug } from '../url'; describe( 'cleanForSlug()', () => { it( 'Should return string prepared for use as url slug', () => { expect( cleanForSlug( '/Is th@t Déjà_vu? ' ) ).toBe( 'is-tht-deja_vu' ); } ); it( 'Should return an empty string for missing argument', () => { expect( cleanForSlug() ).toBe( '' ); } ); it( 'Should return an empty string for falsy argument', () => { expect( cleanForSlug( null ) ).toBe( '' ); } ); } );