test( 'when strings are formed correctly', () => { expect( getWords( 'Modern Tribe' ) ).toEqual( [ 'Modern', 'Tribe' ] ); expect( getWords( 'The Next Generation of Digital Agency' ) ) .toEqual( [ 'The', 'Next', 'Generation', 'of', 'Digital', 'Agency' ] ); expect( getWords( 'A list with numbers: 1, 2, 3' ) ) .toEqual( [ 'A', 'list', 'with', 'numbers:', '1,', '2,', '3' ] ); } );
test( 'Two words last separator is applied', () => { expect( wordsAsList( getWords( 'Modern Tribe' ) ) ).toEqual( 'Modern & Tribe' ); expect( wordsAsList( getWords( 'Events Calendar' ), ',', ' - ' ) ) .toEqual( 'Events - Calendar' ); } );
test( 'Words with multiple spaces on it', () => { expect( getWords( ' Modern Tribe ' ) ).toEqual( [ 'Modern', 'Tribe' ] ); } );