From 4da45c0e760b3a62506f94948749df3b73397385 Mon Sep 17 00:00:00 2001
From: chrismatteson <chris.matteson@gmail.com>
Date: Mon, 15 May 2017 07:09:39 -0700
Subject: [PLT-1444] Created latinise function and updated cleanUpUrlable
 function to utilize (#6273)

---
 webapp/tests/utils/latinise.test.jsx | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 webapp/tests/utils/latinise.test.jsx

(limited to 'webapp/tests/utils/latinise.test.jsx')

diff --git a/webapp/tests/utils/latinise.test.jsx b/webapp/tests/utils/latinise.test.jsx
new file mode 100644
index 000000000..c50859524
--- /dev/null
+++ b/webapp/tests/utils/latinise.test.jsx
@@ -0,0 +1,23 @@
+// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
+// See License.txt for license information.
+
+import {latinise} from 'utils/latinise.jsx';
+
+describe('Latinise', () => {
+    describe('handleNames', () => {
+        test('should return ascii version of Dév Spé', () => {
+            expect(latinise('Dév Spé')).
+                toEqual('Dev Spe');
+        });
+
+        test('should not replace any characters', () => {
+            expect(latinise('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890')).
+                toEqual('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890');
+        });
+
+        test('should replace characters with diacritics with ascii equivalents', () => {
+            expect(latinise('àáâãäåæçèéêëìíîïñòóôõöœùúûüýÿ')).
+                toEqual('aaaaaaaeceeeeiiiinooooooeuuuuyy');
+        });
+    });
+});
-- 
cgit v1.2.3-1-g7c22

