woocommerce/plugins/woocommerce-admin/client/lib/number/test/index.js

20 lines
453 B
JavaScript
Raw Normal View History

2018-08-09 18:50:56 +00:00
/** @format */
/**
* Internal dependencies
*/
import { numberFormat } from '../index';
describe( 'numberFormat', () => {
it( 'should default to en-US formatting', () => {
expect( numberFormat( 1000 ) ).toBe( '1,000' );
} );
it( 'should return an empty string if no argument is passed', () => {
expect( numberFormat() ).toBe( '' );
} );
it( 'should accept a string', () => {
expect( numberFormat( '10000' ) ).toBe( '10,000' );
} );
} );