btlqql opened a new issue, #4016:
URL: https://github.com/apache/rocketmq-dashboard/issues/4016
## Problem
The current test suite does not cover resource name validation in CSV import.
## Expected behavior
- A focused Vitest case locks the existing behavior.
- The targeted test file passes and fails if the covered behavior regresses.
## Scope
Only add regression coverage for $(@{Slug=csv-resource-name; Focus=resource
name validation in CSV import; PrTitle=test(csv-import): cover resource name
validation; TestFile=web/src/utils/resourceCsvImport.test.ts; Mode=existing;
Append=describe('validateResourceName', () => {
it('accepts supported topic and group names and reports unsupported
characters', () => {
expect(validateResourceName('orders-topic_%|1', 'topic')).toBeNull();
expect(validateResourceName('cg_orders', 'group')).toBeNull();
expect(validateResourceName('bad name', 'topic')).toBe('Name
仅支持字母、数字、下划线、短横线、% 和 |');
});
it('rejects empty names and names beyond the per-resource length limit',
() => {
expect(validateResourceName('', 'topic')).toBe('Name 不能为空');
expect(validateResourceName('a'.repeat(128), 'topic')).toBe('Name 长度不能超过
127 个字符');
expect(validateResourceName('a'.repeat(121), 'group')).toBe('Name 长度不能超过
120 个字符');
});
});}.TestFile). No runtime behavior changes.
## Acceptance criteria
- [ ] The targeted Vitest file passes.
- [ ] git diff --check is clean.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]