diff options
Diffstat (limited to 'test/jsUtils.test.ts')
-rw-r--r-- | test/jsUtils.test.ts | 54 |
1 files changed, 51 insertions, 3 deletions
diff --git a/test/jsUtils.test.ts b/test/jsUtils.test.ts index cdded7aca..508f5dd9f 100644 --- a/test/jsUtils.test.ts +++ b/test/jsUtils.test.ts | |||
@@ -96,14 +96,62 @@ describe('jsUtils', () => { | |||
96 | }); | 96 | }); |
97 | }); | 97 | }); |
98 | 98 | ||
99 | describe('isEscKeyPress', () => { | 99 | describe('isArrowUpKeyPress', () => { |
100 | it('returns true if the key is "ArrowUp"', () => { | ||
101 | const result = jsUtils.isArrowUpKeyPress('ArrowUp'); | ||
102 | expect(result).toEqual(true); | ||
103 | }); | ||
104 | |||
105 | it('returns false if the key is some other key', () => { | ||
106 | const result = jsUtils.isArrowUpKeyPress('Backspace'); | ||
107 | expect(result).toEqual(false); | ||
108 | }); | ||
109 | }); | ||
110 | |||
111 | describe('isArrowDownKeyPress', () => { | ||
112 | it('returns true if the key is "ArrowDown"', () => { | ||
113 | const result = jsUtils.isArrowDownKeyPress('ArrowDown'); | ||
114 | expect(result).toEqual(true); | ||
115 | }); | ||
116 | |||
117 | it('returns false if the key is some other key', () => { | ||
118 | const result = jsUtils.isArrowDownKeyPress('Backspace'); | ||
119 | expect(result).toEqual(false); | ||
120 | }); | ||
121 | }); | ||
122 | |||
123 | describe('isEnterKeyPress', () => { | ||
124 | it('returns true if the key is "Enter"', () => { | ||
125 | const result = jsUtils.isEnterKeyPress('Enter'); | ||
126 | expect(result).toEqual(true); | ||
127 | }); | ||
128 | |||
129 | it('returns false if the key is some other key', () => { | ||
130 | const result = jsUtils.isEnterKeyPress('Backspace'); | ||
131 | expect(result).toEqual(false); | ||
132 | }); | ||
133 | }); | ||
134 | |||
135 | describe('isEscapeKeyPress', () => { | ||
100 | it('returns true if the key is "Escape"', () => { | 136 | it('returns true if the key is "Escape"', () => { |
101 | const result = jsUtils.isEscKeyPress('Escape'); | 137 | const result = jsUtils.isEscapeKeyPress('Escape'); |
138 | expect(result).toEqual(true); | ||
139 | }); | ||
140 | |||
141 | it('returns false if the key is some other key', () => { | ||
142 | const result = jsUtils.isEscapeKeyPress('Backspace'); | ||
143 | expect(result).toEqual(false); | ||
144 | }); | ||
145 | }); | ||
146 | |||
147 | describe('isShiftKeyPress', () => { | ||
148 | it('returns true if the key is "Shift"', () => { | ||
149 | const result = jsUtils.isShiftKeyPress('Shift'); | ||
102 | expect(result).toEqual(true); | 150 | expect(result).toEqual(true); |
103 | }); | 151 | }); |
104 | 152 | ||
105 | it('returns false if the key is some other key', () => { | 153 | it('returns false if the key is some other key', () => { |
106 | const result = jsUtils.isEscKeyPress('Backspace'); | 154 | const result = jsUtils.isShiftKeyPress('Backspace'); |
107 | expect(result).toEqual(false); | 155 | expect(result).toEqual(false); |
108 | }); | 156 | }); |
109 | }); | 157 | }); |