Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tomusborne committed Dec 20, 2024
1 parent 10641a6 commit b926803
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/tests/unit/sanitizeHtmlAttribute.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { sanitizeHtmlAttribute } from '../../utils/sanitizeHtmlAttribute';

describe( 'sanitize HTML attribute', () => {
it( 'should return the same value if it is a string', () => {
const value = sanitizeHtmlAttribute( 'foo' );
expect( value ).toEqual( 'foo' );
} );

it( 'should convert a number to a string', () => {
const value = sanitizeHtmlAttribute( 500 );
expect( value ).toEqual( '500' );
Expand Down

0 comments on commit b926803

Please sign in to comment.