aboutsummaryrefslogtreecommitdiffstats
path: root/test/jsUtils.test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'test/jsUtils.test.ts')
-rw-r--r--test/jsUtils.test.ts22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/jsUtils.test.ts b/test/jsUtils.test.ts
index 7245d9a68..411ef28f9 100644
--- a/test/jsUtils.test.ts
+++ b/test/jsUtils.test.ts
@@ -127,4 +127,26 @@ describe('jsUtils', () => {
127 expect(jsUtils.safeParseInt(47.45)).toEqual(47); 127 expect(jsUtils.safeParseInt(47.45)).toEqual(47);
128 }); 128 });
129 }); 129 });
130
131 describe('acceleratorString', () => {
132 it('handles without prefix and suffix', () => {
133 expect(jsUtils.acceleratorString(5, 'abc')).toEqual('(abc+5)');
134 });
135
136 it('handles index = 0', () => {
137 expect(jsUtils.acceleratorString(0, 'abc')).toEqual('(abc+0)');
138 });
139
140 it('handles index = 1', () => {
141 expect(jsUtils.acceleratorString(1, 'abc')).toEqual('(abc+1)');
142 });
143
144 it('handles index = 10', () => {
145 expect(jsUtils.acceleratorString(10, 'abc')).toEqual('(abc+0)');
146 });
147
148 it('handles index = 11', () => {
149 expect(jsUtils.acceleratorString(11, 'abc')).toEqual(undefined);
150 });
151 });
130}); 152});