File "uniqueId.test.ts"

Full path: /home/fsibplc/public_html/sommilito-bank2/splide-4.1.3/src/js/utils/string/uniqueId/uniqueId.test.ts
File size: 622 B (622 B bytes)
MIME-type: text/x-java
Charset: utf-8

Download   Open   Edit   Advanced Editor   Back

import { uniqueId } from './uniqueId';


describe( 'uniqueId', () => {
  test( 'can generate a sequential unique ID.', () => {
    expect( uniqueId( 'container-' ) ).toBe( 'container-01' );
    expect( uniqueId( 'container-' ) ).toBe( 'container-02' );

    expect( uniqueId( 'button-' ) ).toBe( 'button-01' );
    expect( uniqueId( 'button-' ) ).toBe( 'button-02' );

    expect( uniqueId( 'container-' ) ).toBe( 'container-03' );
    expect( uniqueId( 'container-' ) ).toBe( 'container-04' );

    expect( uniqueId( 'button-' ) ).toBe( 'button-03' );
    expect( uniqueId( 'button-' ) ).toBe( 'button-04' );
  } );
} );