Skip to content

Commit c58e7e7

Browse files
committed
fix: resolve failing unit and i18n tests
- Add Brand/Customize and LogoContextMenu to a11y SKIPPED_COMPONENTS - Replace dynamic i18n keys with static $t() calls for color names
1 parent fb287bf commit c58e7e7

File tree

2 files changed

+10
-18
lines changed

2 files changed

+10
-18
lines changed

app/pages/brand.vue

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,9 @@ const logos = [
4747
]
4848
4949
const colors = [
50-
{ key: 'background', hex: '#0a0a0a', oklch: 'oklch(0.171 0 0)', swatch: '#0a0a0a', light: false },
51-
{ key: 'foreground', hex: '#fafafa', oklch: 'oklch(0.982 0 0)', swatch: '#fafafa', light: true },
52-
{
53-
key: 'accent',
54-
hex: '#51c8fc',
55-
oklch: 'oklch(0.787 0.128 230.318)',
56-
swatch: '#51c8fc',
57-
light: true,
58-
},
50+
{ name: () => $t('brand.colors.background'), hex: '#0a0a0a', oklch: 'oklch(0.171 0 0)' },
51+
{ name: () => $t('brand.colors.foreground'), hex: '#fafafa', oklch: 'oklch(0.982 0 0)' },
52+
{ name: () => $t('brand.colors.accent'), hex: '#51c8fc', oklch: 'oklch(0.787 0.128 230.318)' },
5953
]
6054
6155
const { copy, copied, text: lastCopied } = useClipboard({ copiedDuring: 2000 })
@@ -206,25 +200,23 @@ async function handlePngDownload(logo: (typeof logos)[number]) {
206200
<div class="grid grid-cols-2 sm:grid-cols-3 gap-4">
207201
<div
208202
v-for="color in colors"
209-
:key="color.key"
203+
:key="color.hex"
210204
class="group"
211205
role="group"
212-
:aria-label="$t(`brand.colors.${color.key}`)"
206+
:aria-label="color.name()"
213207
>
214208
<div
215209
class="rounded-lg h-20 sm:h-24 mb-3 border border-border"
216210
:style="{ backgroundColor: color.hex }"
217211
/>
218212
<p class="font-mono text-sm text-fg mb-1 m-0">
219-
{{ $t(`brand.colors.${color.key}`) }}
213+
{{ color.name() }}
220214
</p>
221215
<div class="flex flex-col gap-1">
222216
<ButtonBase
223217
size="sm"
224218
class="!border-none !px-0 !justify-start"
225-
:aria-label="
226-
$t('brand.colors.copy_hex', { name: $t(`brand.colors.${color.key}`) })
227-
"
219+
:aria-label="$t('brand.colors.copy_hex', { name: color.name() })"
228220
@click="copy(color.hex)"
229221
>
230222
<code class="text-fg-muted">{{ color.hex }}</code>
@@ -241,9 +233,7 @@ async function handlePngDownload(logo: (typeof logos)[number]) {
241233
<ButtonBase
242234
size="sm"
243235
class="!border-none !px-0 !justify-start"
244-
:aria-label="
245-
$t('brand.colors.copy_oklch', { name: $t(`brand.colors.${color.key}`) })
246-
"
236+
:aria-label="$t('brand.colors.copy_oklch', { name: color.name() })"
247237
@click="copy(color.oklch)"
248238
>
249239
<code class="text-fg-subtle">{{ color.oklch }}</code>

test/unit/a11y-component-coverage.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ const SKIPPED_COMPONENTS: Record<string, string> = {
2929

3030
// Client-only components with complex dependencies
3131
'Header/AuthModal.client.vue': 'Complex auth modal with navigation - requires full app context',
32+
'Brand/Customize.vue': 'Client-only component using useAccentColor, useLocalStorage, and canvas API',
33+
'LogoContextMenu.vue': 'Client-only context menu using Teleport, clipboard API, and pointer events',
3234

3335
// Complex components requiring full app context or specific runtime conditions
3436
'Header/OrgsDropdown.vue': 'Requires connector context and API calls',

0 commit comments

Comments
 (0)