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
14 changes: 8 additions & 6 deletions frontend/__tests__/unit/components/ToggleableList.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ describe('ToggleableList', () => {
expect(header).toHaveClass('mb-4', 'text-2xl', 'font-semibold')
})

it('applies correct CSS to button items', () => {
it('applies correct CSS to button items (no underline, no transition, only hover background)', () => {
const randomItems = ['React', 'Vue', 'Angular']
render(<ToggleableList items={randomItems} label="Styled Buttons" />)
const button = screen.getByText('React')
Expand All @@ -180,14 +180,16 @@ describe('ToggleableList', () => {
'px-3',
'py-1',
'text-sm',
'transition-all',
'duration-200',
'ease-in-out',
'hover:scale-105',
'hover:bg-gray-200',
'hover:underline',
'dark:border-gray-300',
'dark:hover:bg-gray-700'
)
expect(button).not.toHaveClass(
'hover:underline',
'transition-all',
'duration-200',
'ease-in-out',
'hover:scale-105'
)
})
})
2 changes: 1 addition & 1 deletion frontend/src/components/ToggleableList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const ToggleableList = ({
{(showAll ? items : items.slice(0, limit)).map((item, index) => (
<button
key={index}
className="rounded-lg border border-gray-400 px-3 py-1 text-sm transition-all duration-200 ease-in-out hover:scale-105 hover:bg-gray-200 hover:underline dark:border-gray-300 dark:hover:bg-gray-700"
className="rounded-lg border border-gray-400 px-3 py-1 text-sm hover:bg-gray-200 dark:border-gray-300 dark:hover:bg-gray-700"
onClick={() => handleButtonClick({ item })}
>
{item}
Expand Down