Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Tests: Minor rewording.
Browse files Browse the repository at this point in the history
Co-Authored-By: Aleksander Nowodzinski <[email protected]>
  • Loading branch information
mlewand and oleq authored Mar 11, 2020
1 parent d2f6603 commit 32866ae
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe( 'Collection', () => {
expect( collection.get( 'bar' ) ).to.equal( item2 );
} );

it( 'works using an iterable', () => {
it( 'should work using an iterable', () => {
const item1 = getItem( 'foo' );
const item2 = getItem( 'bar' );
const itemsSet = new Set( [ item1, item2 ] );
Expand All @@ -51,23 +51,23 @@ describe( 'Collection', () => {
expect( collection.get( 1 ) ).to.equal( item2 );
} );

it( 'generates id for items that doesn\'t have it', () => {
it( 'should generate ids for items that doesn\'t have it', () => {
const item = {};
const collection = new Collection( [ item ] );

expect( collection.get( 0 ).id ).to.be.a( 'string' );
expect( collection.get( 0 ).id ).not.to.be.empty;
} );

it( 'throws an error when invalid item key is provided', () => {
it( 'should throw an error when an invalid item key is provided', () => {
const badIdItem = getItem( 1 ); // Number id is not supported.

expectToThrowCKEditorError( () => {
return new Collection( [ badIdItem ] );
}, /^collection-add-invalid-id/ );
} );

it( 'throws an error when items have a duplicated key', () => {
it( 'should throw an error when two items have the same key', () => {
const item1 = getItem( 'foo' );
const item2 = getItem( 'foo' );

Expand All @@ -78,7 +78,7 @@ describe( 'Collection', () => {
} );

describe( 'options', () => {
it( 'allow to change the id property used by the collection', () => {
it( 'should allow to change the id property used by the collection', () => {
const item1 = { id: 'foo', name: 'xx' };
const item2 = { id: 'foo', name: 'yy' };
const collection = new Collection( { idProperty: 'name' } );
Expand Down

0 comments on commit 32866ae

Please sign in to comment.