feat: Enhance Company and Job Portal functionality
- Added company nature selection to ManagementList and JobDetailPage. - Implemented detailed tags for job benefits and schedules in JobDetailPage and JobListPage. - Introduced CompanyInfoPage for managing company details, including nature, scale, and contacts. - Enhanced ManagementList to support salary composition, welfare benefits, and work schedule fields. - Created utility functions for parsing and serializing comma-separated tags. - Updated API services to fetch and update current company information. - Added tests for new utility functions to ensure correct parsing and serialization of tags.
This commit is contained in:
21
tests/utils/jobDetailTags.test.ts
Normal file
21
tests/utils/jobDetailTags.test.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { parseCommaSeparatedTags, serializeCommaSeparatedTags } from '@/utils/jobDetailTags';
|
||||
|
||||
describe('job detail tag helpers', () => {
|
||||
it('parses English and Chinese commas, trims values, and removes duplicates', () => {
|
||||
expect(parseCommaSeparatedTags('基本工资, 绩效工资,奖金,基本工资')).toEqual([
|
||||
'基本工资',
|
||||
'绩效工资',
|
||||
'奖金',
|
||||
]);
|
||||
});
|
||||
|
||||
it('keeps dictionary selections and manual entries in one comma-separated value', () => {
|
||||
expect(serializeCommaSeparatedTags(['五险一金', '带薪年假', '生日福利'])).toBe(
|
||||
'五险一金,带薪年假,生日福利',
|
||||
);
|
||||
});
|
||||
|
||||
it('serializes a cleared selector as an empty string so an existing value can be removed', () => {
|
||||
expect(serializeCommaSeparatedTags([])).toBe('');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user