Skip to content

Commit d500d80

Browse files
committed
add additional tests for other languages
1 parent 723c3d0 commit d500d80

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

packages/url/src/test/index.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -978,10 +978,6 @@ describe( 'cleanForSlug', () => {
978978
expect( cleanForSlug( '/Is th@t Déjà_vu? ' ) ).toBe( 'is-tht-deja_vu' );
979979
} );
980980

981-
it( 'Should allow non-latin characters', () => {
982-
expect( cleanForSlug( 'Καλημέρα Κόσμε' ) ).toBe( 'καλημέρα-κόσμε' );
983-
} );
984-
985981
it( 'Should return an empty string for missing argument', () => {
986982
expect( cleanForSlug() ).toBe( '' );
987983
} );
@@ -994,6 +990,17 @@ describe( 'cleanForSlug', () => {
994990
//The last space is an object replacement character
995991
expect( cleanForSlug( 'the long cat' ) ).toBe( 'the-long-cat' );
996992
} );
993+
994+
it( 'Creates a slug for languages that use multibyte encodings', () => {
995+
expect( cleanForSlug( '新荣记 ' ) ).toBe( '新荣记' );
996+
expect( cleanForSlug( '私のテンプレートパーツのテスト ' ) ).toBe(
997+
'私のテンプレートパーツのテスト'
998+
);
999+
expect( cleanForSlug( 'ქართული ნაწილი' ) ).toBe( 'ქართული-ნაწილი' );
1000+
expect( cleanForSlug( 'Καλημέρα Κόσμε' ) ).toBe( 'καλημέρα-κόσμε' );
1001+
expect( cleanForSlug( '안녕하세요 ' ) ).toBe( '안녕하세요' );
1002+
expect( cleanForSlug( '繁体字 ' ) ).toBe( '繁体字' );
1003+
} );
9971004
} );
9981005

9991006
describe( 'normalizePath', () => {

0 commit comments

Comments
 (0)