瀏覽代碼

Simplified and bulletproofed uid() helper tests.

Aleksander Nowodziński 9 年之前
父節點
當前提交
5afc3a3bfd
共有 1 個文件被更改,包括 3 次插入7 次删除
  1. 3 7
      packages/ckeditor5-utils/tests/uid.js

+ 3 - 7
packages/ckeditor5-utils/tests/uid.js

@@ -16,13 +16,9 @@ describe( 'utils', () => {
 			expect( id2 ).to.be.a( 'string' ).to.not.equal( id1 ).to.not.equal( id3 );
 			expect( id3 ).to.be.a( 'string' ).to.not.equal( id1 ).to.not.equal( id2 );
 
-			expect( id1[ 0 ] ).to.match( /[a-z]/ );
-			expect( id2[ 0 ] ).to.match( /[a-z]/ );
-			expect( id3[ 0 ] ).to.match( /[a-z]/ );
-
-			expect( id1 ).to.have.length( 33 );
-			expect( id2 ).to.have.length( 33 );
-			expect( id3 ).to.have.length( 33 );
+			expect( id1 ).to.match( /^[a-z][a-z0-9]{32}$/ );
+			expect( id2 ).to.match( /^[a-z][a-z0-9]{32}$/ );
+			expect( id3 ).to.match( /^[a-z][a-z0-9]{32}$/ );
 		} );
 	} );
 } );