Skip to content

Commit 4179da3

Browse files
fix(ui): hoist findCategoryActionButton to module scope
1 parent 0e24f19 commit 4179da3

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

test/nuxt/components/compare/FacetSelector.spec.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,16 @@ vi.mock('@vueuse/router', () => ({
104104
useRouteQuery: () => ref(''),
105105
}))
106106

107+
function findCategoryActionButton(
108+
component: Awaited<ReturnType<typeof mountSuspended>>,
109+
category: string,
110+
action: 'all' | 'none',
111+
) {
112+
return component.find(
113+
`button[data-facet-category="${category}"][data-facet-category-action="${action}"]`,
114+
)
115+
}
116+
107117
describe('FacetSelector', () => {
108118
beforeEach(() => {
109119
mockSelectedFacets.value = ['downloads', 'types']
@@ -236,16 +246,6 @@ describe('FacetSelector', () => {
236246
})
237247

238248
describe('category all/none buttons', () => {
239-
function findCategoryActionButton(
240-
component: Awaited<ReturnType<typeof mountSuspended>>,
241-
category: string,
242-
action: 'all' | 'none',
243-
) {
244-
return component.find(
245-
`button[data-facet-category="${category}"][data-facet-category-action="${action}"]`,
246-
)
247-
}
248-
249249
it('calls selectCategory when all button is clicked', async () => {
250250
const component = await mountSuspended(FacetSelector)
251251

0 commit comments

Comments
 (0)