Skip to content

Commit 39e97d3

Browse files
committed
fix: added a11y test, translations typo, missing imports
1 parent e8ee375 commit 39e97d3

File tree

4 files changed

+25
-2
lines changed

4 files changed

+25
-2
lines changed

app/pages/compare.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<script setup lang="ts">
22
import { NO_DEPENDENCY_ID } from '~/composables/usePackageComparison'
33
import { useRouteQuery } from '@vueuse/router'
4+
import { escapeHtml } from '#shared/utils/html'
5+
import { NPMX_SITE } from '#shared/utils/constants'
46
57
definePageMeta({
68
name: 'compare',

i18n/locales/pl-PL.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -910,7 +910,7 @@
910910
"section_packages": "Pakiety",
911911
"section_facets": "Aspekty",
912912
"section_comparison": "Porównanie",
913-
"copy_as_markdown": "Kopiuj tabele",
913+
"copy_as_markdown": "Kopiuj tabelę",
914914
"loading": "Ładowanie danych pakietów...",
915915
"error": "Nie udało się wczytać danych pakietów. Spróbuj ponownie.",
916916
"empty_title": "Wybierz pakiety do porównania",

lunaria/files/pl-PL.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,7 @@
909909
"section_packages": "Pakiety",
910910
"section_facets": "Aspekty",
911911
"section_comparison": "Porównanie",
912-
"copy_as_markdown": "Kopiuj tabele",
912+
"copy_as_markdown": "Kopiuj tabelę",
913913
"loading": "Ładowanie danych pakietów...",
914914
"error": "Nie udało się wczytać danych pakietów. Spróbuj ponownie.",
915915
"empty_title": "Wybierz pakiety do porównania",

test/nuxt/a11y.spec.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ import {
124124
CodeFileTree,
125125
CodeMobileTreeDrawer,
126126
CodeViewer,
127+
CopyToClipboardButton,
127128
CollapsibleSection,
128129
ColumnPicker,
129130
CompareComparisonGrid,
@@ -1895,6 +1896,26 @@ describe('component accessibility audits', () => {
18951896
})
18961897
})
18971898

1899+
describe('CopyToClipboardButton', () => {
1900+
it('should have no accessibility violations in default state', async () => {
1901+
const component = await mountSuspended(CopyToClipboardButton, {
1902+
props: { copied: false },
1903+
slots: { default: '<code>npm install vue</code>' },
1904+
})
1905+
const results = await runAxe(component)
1906+
expect(results.violations).toEqual([])
1907+
})
1908+
1909+
it('should have no accessibility violations in copied state', async () => {
1910+
const component = await mountSuspended(CopyToClipboardButton, {
1911+
props: { copied: true },
1912+
slots: { default: '<code>npm install vue</code>' },
1913+
})
1914+
const results = await runAxe(component)
1915+
expect(results.violations).toEqual([])
1916+
})
1917+
})
1918+
18981919
describe('CollapsibleSection', () => {
18991920
it('should have no accessibility violations', async () => {
19001921
const component = await mountSuspended(CollapsibleSection, {

0 commit comments

Comments
 (0)