mirror of
https://github.com/bulwarkmail/webmail.git
synced 2026-10-31 16:13:15 +00:00
16 lines
671 B
TypeScript
16 lines
671 B
TypeScript
import { describe, expect, it } from 'vitest';
|
||
import { stripBidiControls } from '@/lib/bidi';
|
||
|
||
describe('stripBidiControls', () => {
|
||
it('removes the characters that reorder what the reader sees', () => {
|
||
// An RTL override makes `reportfdp.exe` read as `reportexe.pdf`.
|
||
expect(stripBidiControls('reportfdp.exe')).toBe('reportfdp.exe');
|
||
expect(stripBidiControls('ab')).toBe('ab');
|
||
});
|
||
|
||
it('leaves ordinary text, including right-to-left scripts, alone', () => {
|
||
expect(stripBidiControls('Rechnung März.pdf')).toBe('Rechnung März.pdf');
|
||
expect(stripBidiControls('تقرير.pdf')).toBe('تقرير.pdf');
|
||
});
|
||
});
|