diff --git a/frontend/src/i18n/__tests__/i18n.test.ts b/frontend/src/i18n/__tests__/i18n.test.ts index 4df6c34569..b1ae453107 100644 --- a/frontend/src/i18n/__tests__/i18n.test.ts +++ b/frontend/src/i18n/__tests__/i18n.test.ts @@ -24,6 +24,20 @@ describe('i18n configuration', () => { expect(i18n.t('test.fallbackOnly', { lng: 'zh-CN' })).toBe('English fallback'); }); + it.each([ + ['podChat.newPod.label', 'New pod starter actions'], + ['podChat.newPod.title', 'Your pod is ready'], + ['podChat.newPod.inviteLinkLabel', 'Invite link for this pod'], + ['podChat.newPod.addAgentText', 'Choose an agent to add to this pod.'], + ['podsSidebar.discover.empty', 'No community pods to discover right now.'], + ['podsSidebar.discover.joinedEmpty', "You haven't joined any community pods yet."], + ['podsSidebar.discover.loadFailed', "Couldn't load community pods. Try again."], + ['podsSidebar.discover.inviteRequired', 'This pod needs an invite link to join.'], + ['podsSidebar.discover.joinFailed', "Couldn't join this pod. Try again."], + ])('uses lowercase pod in %s', (key, expected) => { + expect(i18n.t(key, { lng: 'en' })).toBe(expected); + }); + it('defaults to English when no stored supported language exists', async () => { const languages = jest.spyOn(window.navigator, 'languages', 'get').mockReturnValue(['en-US']); const language = jest.spyOn(window.navigator, 'language', 'get').mockReturnValue('en-US'); diff --git a/frontend/src/i18n/locales/en.json b/frontend/src/i18n/locales/en.json index e78341ec5e..0e6c25be54 100644 --- a/frontend/src/i18n/locales/en.json +++ b/frontend/src/i18n/locales/en.json @@ -489,18 +489,18 @@ "noMessages": "no messages yet" }, "newPod": { - "label": "New Pod starter actions", - "title": "Your Pod is ready", + "label": "New pod starter actions", + "title": "Your pod is ready", "text": "Bring in people or an agent, or start the conversation yourself.", "dismiss": "Dismiss starter actions", "inviteTitle": "Invite people", "inviteText": "Share this link to bring teammates in.", "preparingInvite": "Creating invite link…", - "inviteLinkLabel": "Invite link for this Pod", + "inviteLinkLabel": "Invite link for this pod", "inviteError": "The invite link could not be created.", "tryAgain": "Try again", "addAgentTitle": "Add an agent", - "addAgentText": "Choose an agent to add to this Pod.", + "addAgentText": "Choose an agent to add to this pod.", "messageTitle": "Write the first message", "messageText": "Start the conversation in the composer." }, @@ -1749,12 +1749,12 @@ "discover": { "join": "Join", "joining": "Joining…", - "empty": "No community Pods to discover right now.", - "joinedEmpty": "You haven't joined any community Pods yet.", - "loadFailed": "Couldn't load community Pods. Try again.", - "inviteRequired": "This Pod needs an invite link to join.", + "empty": "No community pods to discover right now.", + "joinedEmpty": "You haven't joined any community pods yet.", + "loadFailed": "Couldn't load community pods. Try again.", + "inviteRequired": "This pod needs an invite link to join.", "rateLimited": "Too many join attempts. Wait a moment and try again.", - "joinFailed": "Couldn't join this Pod. Try again." + "joinFailed": "Couldn't join this pod. Try again." }, "community": { "title": "Join Commonly HQ", diff --git a/frontend/src/v2/__tests__/V2ThreadStarter.test.tsx b/frontend/src/v2/__tests__/V2ThreadStarter.test.tsx index 5992c7a96e..099ddcdbfb 100644 --- a/frontend/src/v2/__tests__/V2ThreadStarter.test.tsx +++ b/frontend/src/v2/__tests__/V2ThreadStarter.test.tsx @@ -295,7 +295,7 @@ describe('V2Thread just-created Pod starter panel', () => { axios.post.mockResolvedValueOnce({ data: { token } }); renderChat(makeDetail(), { onOpenInvite }); - expect(await screen.findByText('Your Pod is ready')).toBeInTheDocument(); + expect(await screen.findByText('Your pod is ready')).toBeInTheDocument(); await waitFor(() => { expect(axios.post).toHaveBeenCalledWith( '/api/pods/p1/invites', @@ -305,7 +305,7 @@ describe('V2Thread just-created Pod starter panel', () => { }); const inviteUrl = `${window.location.origin}/v2/invite/${token}`; - expect(await screen.findByLabelText('Invite link for this Pod')).toHaveValue(inviteUrl); + expect(await screen.findByLabelText('Invite link for this pod')).toHaveValue(inviteUrl); fireEvent.click(screen.getByRole('button', { name: 'Copy' })); await waitFor(() => expect(navigator.clipboard.writeText).toHaveBeenCalledWith(inviteUrl)); @@ -319,7 +319,7 @@ describe('V2Thread just-created Pod starter panel', () => { test('stays absent without the flag or after messages arrive', async () => { const noFlag = renderChat(makeDetail()); - expect(screen.queryByText('Your Pod is ready')).not.toBeInTheDocument(); + expect(screen.queryByText('Your pod is ready')).not.toBeInTheDocument(); expect(screen.getByText('no messages yet')).toBeInTheDocument(); noFlag.unmount(); @@ -327,7 +327,7 @@ describe('V2Thread just-created Pod starter panel', () => { const withMessage = renderChat(makeDetail({ messages: [{ id: 'm1', content: 'First!', user: { username: 'solo-user' } }], })); - expect(screen.queryByText('Your Pod is ready')).not.toBeInTheDocument(); + expect(screen.queryByText('Your pod is ready')).not.toBeInTheDocument(); await waitFor(() => expect(sessionStorage.getItem('v2.justCreated.p1')).toBeNull()); withMessage.unmount(); }); @@ -336,14 +336,14 @@ describe('V2Thread just-created Pod starter panel', () => { sessionStorage.setItem('v2.justCreated.p1', '1'); renderChat(makeDetail(), { firstRunVisible: true }); - expect(screen.queryByText('Your Pod is ready')).not.toBeInTheDocument(); + expect(screen.queryByText('Your pod is ready')).not.toBeInTheDocument(); expect(axios.post).not.toHaveBeenCalled(); }); test('does not mint an invite when the starter panel does not render', () => { renderChat(makeDetail()); - expect(screen.queryByText('Your Pod is ready')).not.toBeInTheDocument(); + expect(screen.queryByText('Your pod is ready')).not.toBeInTheDocument(); expect(screen.getByText('no messages yet')).toBeInTheDocument(); expect(axios.post).not.toHaveBeenCalled(); }); @@ -353,10 +353,10 @@ describe('V2Thread just-created Pod starter panel', () => { axios.post.mockResolvedValueOnce({ data: { token: 'e'.repeat(32) } }); renderChat(makeDetail()); - expect(await screen.findByText('Your Pod is ready')).toBeInTheDocument(); + expect(await screen.findByText('Your pod is ready')).toBeInTheDocument(); fireEvent.click(screen.getByRole('button', { name: 'Dismiss starter actions' })); - expect(screen.queryByText('Your Pod is ready')).not.toBeInTheDocument(); + expect(screen.queryByText('Your pod is ready')).not.toBeInTheDocument(); expect(sessionStorage.getItem('v2.justCreated.p1')).toBeNull(); }); });