aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLibravatar Vijay A <vraravam@users.noreply.github.com>2024-01-26 08:24:20 +0530
committerLibravatar Vijay Aravamudhan <vraravam@users.noreply.github.com>2024-01-28 03:31:35 +0000
commit6c67387b2978f1a02244a1350725238da35b341b (patch)
treec357ab6826cce8272642c01b0d80120bd5baaa86 /test
parent6.7.1-nightly.11 [skip ci] (diff)
downloadferdium-app-6c67387b2978f1a02244a1350725238da35b341b.tar.gz
ferdium-app-6c67387b2978f1a02244a1350725238da35b341b.tar.zst
ferdium-app-6c67387b2978f1a02244a1350725238da35b341b.zip
chore: minor refactoring to reduce lines and add tests
Diffstat (limited to 'test')
-rw-r--r--test/jsUtils.test.ts16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/jsUtils.test.ts b/test/jsUtils.test.ts
index 138158611..0662c3c48 100644
--- a/test/jsUtils.test.ts
+++ b/test/jsUtils.test.ts
@@ -151,4 +151,20 @@ describe('jsUtils', () => {
151 expect(jsUtils.acceleratorString(11, 'abc')).toEqual(''); 151 expect(jsUtils.acceleratorString(11, 'abc')).toEqual('');
152 }); 152 });
153 }); 153 });
154
155 describe('removeNewLines', () => {
156 it('handles unix style new lines', () => {
157 expect(jsUtils.removeNewLines('abc def\nghi')).toEqual('abc defghi');
158 });
159
160 it('handles windows style new lines', () => {
161 expect(jsUtils.removeNewLines('abc def\r\nghi')).toEqual('abc defghi');
162 });
163
164 it('handles new lines in the beginning, middle and ending of the string', () => {
165 expect(jsUtils.removeNewLines('\nabc def\r\nghi\n')).toEqual(
166 'abc defghi',
167 );
168 });
169 });
154}); 170});