Skip to content

Commit 3acc747

Browse files
jeffredoddclaude
andcommitted
fix: add icons to Holiday policy detail action buttons
Add employees and Edit policy on the Holiday policy detail screen rendered without icons, while the equivalent buttons on the regular TimeOffPolicyDetail screen had PlusCircleIcon and EditIcon. Mirror that treatment so the two policy detail surfaces feel consistent. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 724028c commit 3acc747

2 files changed

Lines changed: 28 additions & 2 deletions

File tree

‎src/components/UNSTABLE_TimeOff/HolidayPolicyDetail/HolidayPolicyDetail.test.tsx‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,20 @@ describe('HolidayPolicyDetail', () => {
9595
expect(screen.getByText('Add employees')).toBeInTheDocument()
9696
expect(screen.getByText('Edit policy')).toBeInTheDocument()
9797
})
98+
99+
it('renders icons on the Add employees and Edit policy buttons', async () => {
100+
renderWithProviders(<HolidayPolicyDetail {...defaultProps} defaultTab="holidays" />)
101+
102+
await waitFor(() => {
103+
expect(screen.getByText('Add employees')).toBeInTheDocument()
104+
})
105+
106+
const addButton = screen.getByRole('button', { name: /add employees/i })
107+
const editButton = screen.getByRole('button', { name: /edit policy/i })
108+
109+
expect(addButton.querySelector('svg')).toBeInTheDocument()
110+
expect(editButton.querySelector('svg')).toBeInTheDocument()
111+
})
98112
})
99113

100114
describe('employees tab', () => {

‎src/components/UNSTABLE_TimeOff/HolidayPolicyDetail/HolidayPolicyDetail.tsx‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ import { useComponentContext } from '@/contexts/ComponentAdapter/useComponentCon
1818
import { useI18n } from '@/i18n'
1919
import { firstLastName } from '@/helpers/formattedStrings'
2020
import TrashCanSvg from '@/assets/icons/trashcan.svg?react'
21+
import EditIcon from '@/assets/icons/edit-02.svg?react'
22+
import PlusCircleIcon from '@/assets/icons/plus-circle.svg?react'
2123

2224
export interface HolidayPolicyDetailProps extends BaseComponentInterface {
2325
companyId: string
@@ -134,10 +136,20 @@ function Root({ companyId, defaultTab = 'holidays' }: HolidayPolicyDetailProps)
134136
}
135137

136138
const actions = [
137-
<Button key="add" variant="secondary" onClick={handleAddEmployees}>
139+
<Button
140+
key="add"
141+
variant="secondary"
142+
icon={<PlusCircleIcon aria-hidden />}
143+
onClick={handleAddEmployees}
144+
>
138145
{t('show.addEmployeesCta')}
139146
</Button>,
140-
<Button key="edit" variant="secondary" onClick={handleEditPolicy}>
147+
<Button
148+
key="edit"
149+
variant="secondary"
150+
icon={<EditIcon aria-hidden />}
151+
onClick={handleEditPolicy}
152+
>
141153
{t('show.editPolicyCta')}
142154
</Button>,
143155
]

0 commit comments

Comments
 (0)