1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Prevent blank playlist names

This commit is contained in:
Bill Thornton 2024-10-13 12:00:10 -04:00
parent 363171b56d
commit a37388b2e3
3 changed files with 37 additions and 3 deletions

View file

@ -1,6 +1,24 @@
import { describe, expect, it } from 'vitest';
import { toBoolean, toFloat } from './string';
import { isBlank, toBoolean, toFloat } from './string';
describe('isBlank', () => {
it('Should return true if the string is blank', () => {
let check = isBlank(undefined);
expect(check).toBe(true);
check = isBlank(null);
expect(check).toBe(true);
check = isBlank('');
expect(check).toBe(true);
check = isBlank(' \t\t ');
expect(check).toBe(true);
});
it('Should return false if the string is not blank', () => {
const check = isBlank('not an empty string');
expect(check).toBe(false);
});
});
describe('toBoolean', () => {
it('Should return the boolean represented by the string', () => {