Skip to content

Commit

Permalink
Date: Add test that ordinal suffix works.
Browse files Browse the repository at this point in the history
See #15221
  • Loading branch information
iandunn committed Apr 26, 2019
1 parent 0c146bc commit 054c5d3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/date/src/test/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Internal dependencies
*/
import { isInTheFuture, getDate, setSettings, __experimentalGetSettings } from '../';
import { isInTheFuture, getDate, format, setSettings, __experimentalGetSettings } from '../';

describe( 'isInTheFuture', () => {
it( 'should return true if the date is in the future', () => {
Expand Down Expand Up @@ -38,3 +38,10 @@ describe( 'isInTheFuture', () => {
setSettings( settings );
} );
} );

describe( 'format', () => {
it( 'should map ordinal suffix to moment.js equivalent', () => {
expect( format( 'S', '2019-04-26' ) ).toBe( 'th' );
expect( format( 'l, F jS', '2019-04-26' ) ).toBe( 'Friday, April 26th' );
} );
} );

0 comments on commit 054c5d3

Please sign in to comment.