File "create.test.ts"

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

Download   Open   Edit   Advanced Editor   Back

import { create } from './create';


describe( 'create', () => {
  test( 'can create an element by a tag name.', () => {
    const div = create( 'div' );
    const iframe = create( 'iframe' );

    expect( div instanceof HTMLDivElement ).toBe( true );
    expect( iframe instanceof HTMLIFrameElement ).toBe( true );
  } );

  test( 'can create an element with setting attributes.', () => {
    const iframe = create( 'iframe', { width: 100, height: 200 } );

    expect( iframe.getAttribute( 'width' ) ).toBe( '100' );
    expect( iframe.getAttribute( 'height' ) ).toBe( '200' );
  } );
} );