Files
lucide/packages/shared/tests/isEmptyString.spec.ts
Eric Fennis b6ed43d48c feat(packages): Added aria-hidden fallback for decorative icons to all packages (#3604)
* Add aria hidden to lucide package

* Add aria-hidden to astro package

* Add tests for shared package

* Fix test for props

* add aria prop to lucide-solid

* Add aria-hidden to lucide-vue-next

* Add aria-hidden prop to angular package

* Fix builds

* Add notice about aria-label in docs

* Format code

* Update packages/svelte/tests/Icon.spec.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update packages/lucide-svelte/tests/Icon.spec.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update packages/shared/src/utils/hasA11yProp.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Adjusted docs

* Fix import

* update tests

* test(shared): fix hasA11yProp unit test

* fix(packages/lucide-angular): fix hasA11yProp import path (non-relative import path will not get properly resolved by ng-packagr)

* Format code

* Adjust aria props to root element

* Format code

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Karsa <contact@karsa.org>
2026-01-20 15:55:02 +01:00

47 lines
1.3 KiB
TypeScript

import { describe, it, expect } from 'vitest';
import { isEmptyString } from '../src/utils/isEmptyString';
describe('isEmptyString', () => {
it('should return true for an empty string', () => {
expect(isEmptyString('')).toBe(true);
});
it('should return false for a non-empty string', () => {
expect(isEmptyString('hello')).toBe(false);
expect(isEmptyString(' ')).toBe(false);
expect(isEmptyString('0')).toBe(false);
});
it('should return false for null', () => {
expect(isEmptyString(null)).toBe(false);
});
it('should return false for undefined', () => {
expect(isEmptyString(undefined)).toBe(false);
});
it('should return false for numbers', () => {
expect(isEmptyString(0)).toBe(false);
expect(isEmptyString(123)).toBe(false);
expect(isEmptyString(NaN)).toBe(false);
});
it('should return false for objects', () => {
expect(isEmptyString({})).toBe(false);
expect(isEmptyString([])).toBe(false);
});
it('should return false for boolean values', () => {
expect(isEmptyString(true)).toBe(false);
expect(isEmptyString(false)).toBe(false);
});
it('should return false for symbols', () => {
expect(isEmptyString(Symbol())).toBe(false);
});
it('should return false for functions', () => {
expect(isEmptyString(() => {})).toBe(false);
});
});