19 | {{ $t('conversation.with') }} 20 |
21 |13 | 14 | {{ getShortHandle(account) }} 15 | @{{ serverName }} 16 |
17 | 18 | -------------------------------------------------------------------------------- /components/account/AccountHoverCard.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 |
19 |
15 | {{ build.shortCommit }}
18 |
{{ $t('help.build_preview.desc2') }}
22 |23 | {{ $t('help.build_preview.desc3') }} 24 |
25 | 26 |21 | {{ $t('command.n_people_in_the_past_n_days', [people, maxDay]) }} 22 |
23 | 24 | -------------------------------------------------------------------------------- /components/common/CommonTrendingCharts.vue: -------------------------------------------------------------------------------- 1 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /components/common/LocalizedNumber.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 |{{ raw }}23 | 24 | -------------------------------------------------------------------------------- /components/content/ContentMentionGroup.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 |
9 |
19 | {{ $t('conversation.with') }} 20 |
21 |23 | {{ provider }} 24 |
25 | {{ card.title }} 29 |33 | {{ card.description }} 34 |
35 |
54 |
8 |
13 | {{ $t(singleInstanceServer ? 'user.single_instance_sign_in_desc' : 'user.sign_in_desc') }} 14 |
15 | 27 | 30 |{{ $t('tooltip.explore_posts_intro') }}
26 |{{ $t('tooltip.explore_links_intro') }}
26 |{{ $t('tooltip.explore_tags_intro') }}
29 |text code
inline
text
code
'))
11 | .toMatchInlineSnapshot(`
12 | "text
13 | \`\`\`js
14 | code
15 | \`\`\`"
16 | `)
17 | })
18 |
19 | it('bold & italic', () => {
20 | expect(htmlToText('text bold italic
')) 21 | .toMatchInlineSnapshot('"text **bold** *italic*"') 22 | }) 23 | }) 24 | -------------------------------------------------------------------------------- /tests/setup.ts: -------------------------------------------------------------------------------- 1 | // We have TypeError: AbortSignal.timeout is not a function when running tests against masto.js v6 2 | if (!AbortSignal.timeout) { 3 | AbortSignal.timeout = (ms) => { 4 | const controller = new AbortController() 5 | setTimeout(() => controller.abort(new DOMException('TimeoutError')), ms) 6 | return controller.signal 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /tests/unit/language.test.ts: -------------------------------------------------------------------------------- 1 | import { describe, expect, it } from 'vitest' 2 | import { matchLanguages } from '../../utils/language' 3 | 4 | describe('language', () => { 5 | it('match language', () => { 6 | expect(matchLanguages(['zh-CN', 'zh-TW'], ['zh'])).toMatchInlineSnapshot('"zh-CN"') 7 | expect(matchLanguages(['zh-CN', 'zh-TW'], ['en'])).toMatchInlineSnapshot('null') 8 | 9 | expect(matchLanguages(['zh-CN', 'zh-TW', 'en-US'], ['zh', 'en'])).toMatchInlineSnapshot('"zh-CN"') 10 | expect(matchLanguages(['zh-CN', 'zh-TW', 'en-US'], ['en', 'zh-CN'])).toMatchInlineSnapshot('"en-US"') 11 | expect(matchLanguages(['zh-CN', 'zh-TW', 'en-US'], ['zh-TW', 'en'])).toMatchInlineSnapshot('"zh-TW"') 12 | 13 | expect(matchLanguages(['zh-TW', 'en-US'], ['zh-CN', 'en-GB'])).toMatchInlineSnapshot('"zh-TW"') 14 | expect(matchLanguages(['zh-TW', 'en-GB'], ['ja-JP', 'zh-CN'])).toMatchInlineSnapshot('"zh-TW"') 15 | 16 | expect(matchLanguages(['zh-TW'], ['zh-tw'])).toMatchInlineSnapshot('"zh-TW"') 17 | }) 18 | }) 19 | -------------------------------------------------------------------------------- /tests/unit/permalinks.test.ts: -------------------------------------------------------------------------------- 1 | import { describe, expect, it } from 'vitest' 2 | import { HANDLED_MASTO_URLS } from '~/constants' 3 | 4 | const validPermalinks = [ 5 | 'https://m1as-social34.to.social/@elk', 6 | 'https://m1as-social34.to.social/@elk22/123', 7 | 'https://m1as-social34.to.social/@elk22/objects/123', 8 | 'webtoo.ls/@elk', 9 | ] 10 | 11 | const invalidPermalinks = [ 12 | 'https://webtoo.ls', 13 | 'https://webtoo.ls/elk/123', 14 | ] 15 | 16 | describe('permalinks', () => { 17 | it.each(validPermalinks)('should recognise %s', (url) => { 18 | expect(HANDLED_MASTO_URLS.test(url)).toBe(true) 19 | }) 20 | it.each(invalidPermalinks)('should not recognise %s', (url) => { 21 | expect(HANDLED_MASTO_URLS.test(url)).toBe(false) 22 | }) 23 | }) 24 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./.nuxt/tsconfig.json" 3 | } 4 | -------------------------------------------------------------------------------- /types/translation-status.ts: -------------------------------------------------------------------------------- 1 | export interface NimbusTranslationStatus { 2 | total: number 3 | locales: Record