Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions apps/systemtags/src/components/SystemTagForm.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/**
* SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

import type { VueWrapper } from '@vue/test-utils'
import type { TagWithId } from '../types.ts'

import { mount } from '@vue/test-utils'
import { afterEach, describe, expect, it } from 'vitest'
import SystemTagForm from './SystemTagForm.vue'

const tags: TagWithId[] = Array.from({ length: 8 }, (_, index) => ({
id: index + 1,
displayName: `tag ${index + 1}`,
userVisible: true,
userAssignable: true,
canAssign: true,
}))

describe('SystemTagForm', () => {
let component: VueWrapper

afterEach(() => {
component?.unmount()
})

it('offers every tag for editing', () => {
component = mount(SystemTagForm, { props: { tags } })

const select = component.findComponent({ name: 'VueSelect' })

expect(select.vm.filteredOptions).toHaveLength(tags.length)
})
})
1 change: 1 addition & 0 deletions apps/systemtags/src/components/SystemTagForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ function getTagLevel(userVisible: boolean, userAssignable: boolean): TagLevel {
:placeholder="t('systemtags', 'Collaborative tags …')"
:fetchTags="false"
:options="tags"
:limit="null"
:multiple="false"
labelOutside
@update:modelValue="onSelectTag">
Expand Down
1 change: 1 addition & 0 deletions apps/systemtags/src/components/SystemTags.vue
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ async function updateAndDispatchNodeTagsEvent(fileId: number) {
:inputLabel="t('systemtags', 'Search or create collaborative tags')"
:placeholder="t('systemtags', 'Collaborative tags …')"
:options="sortedTags"
:limit="null"
:modelValue="selectedTags"
:createOption="createOption"
:disabled="disabled"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<template>
<NcSelectTags
v-model="newValue"
:limit="null"
:multiple="false"
@input="update" />
</template>
Expand Down
Loading