From 51b6a310acdcd3fb5530d52a468e2845ba3d0e9e Mon Sep 17 00:00:00 2001 From: Diem-Trang Pham <6422507+pdtrang@users.noreply.github.com> Date: Wed, 10 Dec 2025 19:54:05 -0600 Subject: [PATCH] =?UTF-8?q?test(client):=20add=20test=20for=20=C3=BC=20cha?= =?UTF-8?q?racter=20conversion=20to=20PinyinToHanziInput=20(#64484)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Huyen Nguyen <25715018+huyenltnguyen@users.noreply.github.com> --- .../components/pinyin-to-hanzi-input.test.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/client/src/templates/Challenges/components/pinyin-to-hanzi-input.test.tsx b/client/src/templates/Challenges/components/pinyin-to-hanzi-input.test.tsx index da71228028a..63a8a6849e7 100644 --- a/client/src/templates/Challenges/components/pinyin-to-hanzi-input.test.tsx +++ b/client/src/templates/Challenges/components/pinyin-to-hanzi-input.test.tsx @@ -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', () => {