Skip to content

Commit 8b542bc

Browse files
committed
#RI-2930 - add unit tests
1 parent 5eeb382 commit 8b542bc

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

redisinsight/ui/src/utils/tests/validations.spec.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ import {
1515
MAX_REFRESH_RATE,
1616
errorValidateRefreshRateNumber,
1717
errorValidateNegativeInteger,
18-
} from '../validations'
18+
validateConsumerGroupId
19+
} from 'uiSrc/utils'
1920

2021
const text1 = '123 123 123'
2122
const text2 = 'lorem lorem12312 lorem'
@@ -248,4 +249,17 @@ describe('Validations utils', () => {
248249
expect(result).toBe(expected)
249250
})
250251
})
252+
253+
describe('validateConsumerGroupId', () => {
254+
it.each([
255+
['123', '123'],
256+
['123-1', '123-1'],
257+
['$', '$'],
258+
['11.zx-1', '11-1'],
259+
])('for input: %s (input), should be output: %s',
260+
(input, expected) => {
261+
const result = validateConsumerGroupId(input)
262+
expect(result).toBe(expected)
263+
})
264+
})
251265
})

0 commit comments

Comments
 (0)