diff --git a/frontend/src/i18n/locales/en.json b/frontend/src/i18n/locales/en.json index 3dbd8b52a5..b7b28bf7df 100644 --- a/frontend/src/i18n/locales/en.json +++ b/frontend/src/i18n/locales/en.json @@ -1704,7 +1704,7 @@ "verified": "{{name}} is listening — mentions will wake it.", "stillWaiting": "Still no check-in from {{name}}. Run the command above in Terminal on your computer, and this page will confirm it.", "ctaWarning": "{{name}} isn’t listening yet: it won’t answer mentions until the command above is running.", - "needs": "Needs Node 18+ with npm and {{tool}} signed in. Run all four lines in one window: the exports last only there.", + "needs": "Needs Node 20+ with npm and {{tool}} signed in. Run all four lines in one window: the exports last only there.", "osLabel": "Setting up on:", "osLinux": "Linux", "osMac": "Mac", diff --git a/frontend/src/i18n/locales/zh-CN.json b/frontend/src/i18n/locales/zh-CN.json index 4755445bb2..13c77d5e25 100644 --- a/frontend/src/i18n/locales/zh-CN.json +++ b/frontend/src/i18n/locales/zh-CN.json @@ -1764,7 +1764,7 @@ "verified": "{{name}} 已在监听 —— @提及 会唤醒它。", "stillWaiting": "{{name}} 还没接入。请在你电脑的终端里运行上面的命令,这里会自动确认。", "ctaWarning": "{{name}} 尚未监听:上面的命令运行起来之前,它不会回复 @提及。", - "needs": "需要 Node 18+(含 npm)和已登录的 {{tool}}。四行都要在同一个窗口里运行,换了窗口 export 就失效。", + "needs": "需要 Node 20+(含 npm)和已登录的 {{tool}}。四行都要在同一个窗口里运行,换了窗口 export 就失效。", "osLabel": "你的系统:", "osLinux": "Linux", "osMac": "Mac", diff --git a/frontend/src/v2/__tests__/V2AgentBYOListenSnippet.test.tsx b/frontend/src/v2/__tests__/V2AgentBYOListenSnippet.test.tsx index 977d8658e4..dd3b1e5481 100644 --- a/frontend/src/v2/__tests__/V2AgentBYOListenSnippet.test.tsx +++ b/frontend/src/v2/__tests__/V2AgentBYOListenSnippet.test.tsx @@ -12,6 +12,10 @@ import { MemoryRouter } from 'react-router-dom'; import V2AgentBYO from '../components/V2AgentBYO'; import { AuthContext } from '../../context/AuthContext'; +// The page names the Node floor the CLI declares. Read it from cli/package.json +// rather than copying the number, so a CLI engines bump fails this test. +const CLI_NODE_FLOOR = Number(require('../../../../cli/package.json').engines.node.match(/\d+/)[0]); + jest.mock('../components/V2NavRail', () => () => null); jest.mock('axios', () => { const mock = { @@ -143,11 +147,18 @@ describe('BYO listener snippet', () => { test('what it needs is said before the command it is about', async () => { await issueToken(); const needs = screen.getByTestId('byo-listen-needs'); - expect(needs).toHaveTextContent(/Needs Node 18\+ with npm and Claude Code signed in/); + expect(needs).toHaveTextContent(new RegExp(`Needs Node ${CLI_NODE_FLOOR}\\+ with npm and Claude Code signed in`)); // eslint-disable-next-line no-bitwise expect(needs.compareDocumentPosition(listenCommand()) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy(); }); + // The page renders in English here, so the English test above never reads the + // zh-CN copy. Read the zh-CN string straight from the locale file. + test('the zh-CN "needs" line names the same Node floor', () => { + const zhNeeds: string = require('../../i18n/locales/zh-CN.json').agentByo.listen.needs; + expect(zhNeeds).toMatch(new RegExp(`需要 Node ${CLI_NODE_FLOOR}\\+`)); + }); + test('"I use Codex instead" gives a Codex command and says Codex is what it needs', async () => { await issueToken(); fireEvent.click(screen.getByTestId('byo-listen-adapter-switch'));