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
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const selectedLabelIds = defineModel<string[]>('selectedLabelIds', { required: t
class="inline-flex items-center gap-2 px-3 py-1.5 rounded-md text-sm font-medium transition-all cursor-pointer"
:class="[
selectedLabelIds.includes(label.id)
? 'text-white ring-2 ring-offset-2 ring-primary td-dynamic-bg'
? 'text-white ring-2 ring-offset-2 ring-offset-surface-container ring-primary td-dynamic-bg'
: 'text-on-surface bg-surface-container-high hover:bg-surface-container-highest',
]"
:style="selectedLabelIds.includes(label.id) ? { '--td-dynamic-color': label.colorHex } : undefined"
Expand Down
26 changes: 26 additions & 0 deletions frontend/taskdeck-web/src/tests/components/CardModal.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,32 @@ describe('CardModal', () => {
expect(bugLabelCheckbox.element.checked).toBe(true)
})

it('uses the card modal surface for the selected label ring offset', () => {
const cardWithLabel = {
...card,
labels: [labels[0]],
}

const wrapper = mount(CardModal, {
props: {
card: cardWithLabel,
isOpen: true,
labels,
},
})

const selectedInput = wrapper.get('#label-label-1')
const unselectedInput = wrapper.get('#label-label-2')
const selectedLabel = selectedInput.element.closest('label')
const unselectedLabel = unselectedInput.element.closest('label')

expect(selectedLabel).toBeDefined()
expect(unselectedLabel).toBeDefined()
expect(selectedLabel!.classList).toContain('ring-offset-surface-container')
expect(selectedLabel!.classList).toContain('ring-offset-2')
expect(unselectedLabel!.classList).not.toContain('ring-offset-surface-container')
})

it('should create a new comment from modal comment input', async () => {
const wrapper = mount(CardModal, {
props: {
Expand Down
Loading