mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2025-12-19 18:18:27 -05:00
test(client): add test for ü character conversion to PinyinToHanziInput (#64484)
Co-authored-by: Huyen Nguyen <25715018+huyenltnguyen@users.noreply.github.com>
This commit is contained in:
@@ -100,6 +100,17 @@ describe('convertToHanzi', () => {
|
||||
'你好'
|
||||
);
|
||||
});
|
||||
|
||||
test('should convert "v" to "ü" and support tone marks', () => {
|
||||
// Correct tone gets converted to hanzi
|
||||
expect(convertToHanzi('nv3', { hanzi: '女', pinyin: 'nǚ' })).toBe('女');
|
||||
|
||||
// Incorrect tones stay as pinyin
|
||||
expect(convertToHanzi('nv1', { hanzi: '女', pinyin: 'nǚ' })).toBe('nǖ');
|
||||
expect(convertToHanzi('nv2', { hanzi: '女', pinyin: 'nǚ' })).toBe('nǘ');
|
||||
expect(convertToHanzi('nv4', { hanzi: '女', pinyin: 'nǚ' })).toBe('nǜ');
|
||||
expect(convertToHanzi('nv5', { hanzi: '女', pinyin: 'nǚ' })).toBe('nü');
|
||||
});
|
||||
});
|
||||
|
||||
describe('PinyinToHanziInput component', () => {
|
||||
|
||||
Reference in New Issue
Block a user