@splidejs/splide
Version:
Splide is a lightweight, flexible and accessible slider/carousel. No dependencies, no Lighthouse errors.
19 lines (13 loc) • 640 B
text/typescript
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' );
} );
} );