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.ts46
1 files changed, 41 insertions, 5 deletions
diff --git a/test/jsUtils.test.ts b/test/jsUtils.test.ts
index 508f5dd9f..b40b21b2a 100644
--- a/test/jsUtils.test.ts
+++ b/test/jsUtils.test.ts
@@ -180,23 +180,59 @@ describe('jsUtils', () => {
180 180
181 describe('acceleratorString', () => { 181 describe('acceleratorString', () => {
182 it('handles without prefix and suffix', () => { 182 it('handles without prefix and suffix', () => {
183 expect(jsUtils.acceleratorString(5, 'abc')).toEqual('(abc+5)'); 183 expect(
184 jsUtils.acceleratorString({
185 index: 5,
186 keyCombo: 'abc',
187 }),
188 ).toEqual('(abc+5)');
184 }); 189 });
185 190
186 it('handles index = 0', () => { 191 it('handles index = 0', () => {
187 expect(jsUtils.acceleratorString(0, 'abc')).toEqual('(abc+0)'); 192 expect(
193 jsUtils.acceleratorString({
194 index: 0,
195 keyCombo: 'abc',
196 }),
197 ).toEqual('(abc+0)');
188 }); 198 });
189 199
190 it('handles index = 1', () => { 200 it('handles index = 1', () => {
191 expect(jsUtils.acceleratorString(1, 'abc')).toEqual('(abc+1)'); 201 expect(
202 jsUtils.acceleratorString({
203 index: 1,
204 keyCombo: 'abc',
205 }),
206 ).toEqual('(abc+1)');
192 }); 207 });
193 208
194 it('handles index = 10', () => { 209 it('handles index = 10', () => {
195 expect(jsUtils.acceleratorString(10, 'abc')).toEqual('(abc+0)'); 210 expect(
211 jsUtils.acceleratorString({
212 index: 10,
213 keyCombo: 'abc',
214 maxIndex: 10,
215 }),
216 ).toEqual('(abc+0)');
196 }); 217 });
197 218
198 it('handles index = 11', () => { 219 it('handles index = 11', () => {
199 expect(jsUtils.acceleratorString(11, 'abc')).toEqual(''); 220 expect(
221 jsUtils.acceleratorString({
222 index: 11,
223 keyCombo: 'abc',
224 }),
225 ).toEqual('');
226 });
227
228 it('handles index = 9, maxIndex = 8', () => {
229 expect(
230 jsUtils.acceleratorString({
231 index: 9,
232 maxIndex: 8,
233 keyCombo: 'abc',
234 }),
235 ).toEqual('');
200 }); 236 });
201 }); 237 });
202 238