mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-14 11:53:49 +00:00
34360a5b8f
Co-authored-by: Carlos Valente <34649812+cpvalente@users.noreply.github.com>
26 lines
743 B
TypeScript
26 lines
743 B
TypeScript
import { describe, expect, it } from 'vitest';
|
|
|
|
import { removeFileExtension } from '../uploadUtils';
|
|
|
|
describe('removeFileExtension()', () => {
|
|
it('removes a trailing extension', () => {
|
|
expect(removeFileExtension('show.xlsx')).toBe('show');
|
|
});
|
|
|
|
it('only removes the last extension', () => {
|
|
expect(removeFileExtension('my.show.xlsx')).toBe('my.show');
|
|
});
|
|
|
|
it('returns the name unchanged when there is no extension', () => {
|
|
expect(removeFileExtension('rundown')).toBe('rundown');
|
|
});
|
|
|
|
it('does not treat a leading dot as an extension', () => {
|
|
expect(removeFileExtension('.gitignore')).toBe('.gitignore');
|
|
});
|
|
|
|
it('handles an empty string', () => {
|
|
expect(removeFileExtension('')).toBe('');
|
|
});
|
|
});
|