Skip to content

Commit

Permalink
Add text node asserts tests for isVisible
Browse files Browse the repository at this point in the history
  • Loading branch information
Mati365 committed Aug 22, 2024
1 parent 1ec659d commit c004e3c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/ckeditor5-utils/tests/dom/isvisible.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,17 @@ describe( 'isVisible()', () => {

expect( isVisible( element ) ).to.be.false;
} );

it( 'should return visibility of parent element if text node is passed', () => {
document.body.appendChild( element );

const textNode = document.createTextNode( 'foo' );
element.appendChild( textNode );

expect( isVisible( textNode ) ).to.be.true;

element.style.display = 'none';

expect( isVisible( textNode ) ).to.be.false;
} );
} );

0 comments on commit c004e3c

Please sign in to comment.