From 582261f70b91c5ae32cef54778b5dce6f960909b Mon Sep 17 00:00:00 2001 From: Huyen Nguyen <25715018+huyenltnguyen@users.noreply.github.com> Date: Thu, 29 Jan 2026 10:36:36 +0700 Subject: [PATCH] test(challenge-parser): add test for 'highlighted-text' class (#65546) --- .../parser/plugins/utils/i18n-stringify.test.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tools/challenge-parser/parser/plugins/utils/i18n-stringify.test.js b/tools/challenge-parser/parser/plugins/utils/i18n-stringify.test.js index 9b043bd0f60..a8371cec74e 100644 --- a/tools/challenge-parser/parser/plugins/utils/i18n-stringify.test.js +++ b/tools/challenge-parser/parser/plugins/utils/i18n-stringify.test.js @@ -252,6 +252,20 @@ describe('createMdastToHtml', () => { ); }); + // NOTE: The mobile app looks for the 'highlighted-text' class to apply highlighted styles. + // Notify the mobile team if the class name is changed or removed. + it("should include the 'highlighted-text' class when rendering as span", () => { + const toHtml = createMdastToHtml('en-US'); + const nodes = [ + { + type: 'paragraph', + children: [{ type: 'inlineCode', value: 'highlighted' }] + } + ]; + const actual = toHtml(nodes); + expect(actual).toMatch(/class="highlighted-text"/); + }); + it('should render as regular code when lang is not zh-CN, en-US, or es', () => { const toHtml = createMdastToHtml('zh'); const nodes = [