Skip to content

Commit 9966013

Browse files
authored
Merge branch 'main' into chore/SDK-176
2 parents 9ffecb3 + 391e58f commit 9966013

File tree

5 files changed

+395
-49
lines changed

5 files changed

+395
-49
lines changed

src/components/Payroll/PayrollOverview/PayrollOverview.stories.tsx

Lines changed: 151 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,25 @@ export default {
55
title: 'Domain/Payroll/PayrollOverview',
66
}
77

8-
export const PayrollOverviewStory = () => {
9-
const submissionBlockers = [
10-
{
11-
blockerType: 'fast_ach_threshold_exceeded',
12-
blockerName: 'Fast ACH Threshold Exceeded',
13-
status: 'unresolved' as const,
14-
unblockOptions: [
15-
{
16-
unblockType: 'wire_in',
17-
checkDate: '2025-09-20',
18-
},
19-
{
20-
unblockType: 'move_to_four_day',
21-
checkDate: '2025-09-24',
22-
},
23-
],
24-
},
25-
]
8+
const submissionBlockers = [
9+
{
10+
blockerType: 'fast_ach_threshold_exceeded',
11+
blockerName: 'Fast ACH Threshold Exceeded',
12+
status: 'unresolved' as const,
13+
unblockOptions: [
14+
{
15+
unblockType: 'wire_in',
16+
checkDate: '2025-09-20',
17+
},
18+
{
19+
unblockType: 'move_to_four_day',
20+
checkDate: '2025-09-24',
21+
},
22+
],
23+
},
24+
]
2625

26+
export const PayrollOverviewStory = () => {
2727
return (
2828
<PayrollOverviewPresentation
2929
onEdit={action('edit')}
@@ -1865,3 +1865,136 @@ export const PayrollOverviewStory = () => {
18651865
/>
18661866
)
18671867
}
1868+
1869+
export const PayrollOverviewWithWireFunds = () => {
1870+
return (
1871+
<PayrollOverviewPresentation
1872+
onEdit={action('edit')}
1873+
onSubmit={action('submit')}
1874+
taxes={{ 'Some tax': { employee: 100, employer: 200 } }}
1875+
isProcessed={false}
1876+
isSubmitting={false}
1877+
submissionBlockers={submissionBlockers}
1878+
selectedUnblockOptions={{ fast_ach_threshold_exceeded: 'wire_in' }}
1879+
onUnblockOptionChange={action('onUnblockOptionChange')}
1880+
onCancel={action('cancel')}
1881+
onPayrollReceipt={action('payrollReceipt')}
1882+
onPaystubDownload={action('paystubDownload')}
1883+
payrollData={{
1884+
payrollDeadline: new Date('2025-09-24T23:00:00.000Z'),
1885+
checkDate: '2025-09-26',
1886+
processed: false,
1887+
processedDate: null,
1888+
calculatedAt: new Date('2025-09-15T16:25:07.000Z'),
1889+
uuid: '9f2013b1-caa6-4b49-8ae2-abc988615808',
1890+
payrollUuid: '9f2013b1-caa6-4b49-8ae2-abc988615808',
1891+
companyUuid: '624e94a3-da0a-48e1-9f9b-667f8d502ce1',
1892+
offCycle: false,
1893+
autoPilot: false,
1894+
external: false,
1895+
payPeriod: {
1896+
startDate: '2025-09-12',
1897+
endDate: '2025-09-18',
1898+
payScheduleUuid: '3bef2adc-5ffb-4575-94d7-2e34c3e7c0ac',
1899+
},
1900+
totals: {
1901+
companyDebit: '8804.53',
1902+
netPayDebit: '10453.44',
1903+
taxDebit: '4917.37',
1904+
reimbursementDebit: '0.00',
1905+
childSupportDebit: '0.00',
1906+
reimbursements: '0.00',
1907+
netPay: '10453.44',
1908+
grossPay: '13754.60',
1909+
employeeBonuses: '0.00',
1910+
employeeCommissions: '0.00',
1911+
employeeCashTips: '0.00',
1912+
employeePaycheckTips: '0.00',
1913+
additionalEarnings: '0.00',
1914+
ownersDraw: '0.00',
1915+
checkAmount: '0.00',
1916+
employerTaxes: '1616.21',
1917+
employeeTaxes: '3301.16',
1918+
benefits: '0.00',
1919+
employeeBenefitsDeductions: '0.00',
1920+
imputedPay: '0.00',
1921+
deferredPayrollTaxes: '0.00',
1922+
otherDeductions: '0.00',
1923+
},
1924+
companyTaxes: [],
1925+
employeeCompensations: [],
1926+
}}
1927+
employeeDetails={[]}
1928+
/>
1929+
)
1930+
}
1931+
1932+
export const PayrollOverviewWith4DayDirectDeposit = () => {
1933+
return (
1934+
<PayrollOverviewPresentation
1935+
onEdit={action('edit')}
1936+
onSubmit={action('submit')}
1937+
taxes={{ 'Some tax': { employee: 100, employer: 200 } }}
1938+
isProcessed={false}
1939+
isSubmitting={false}
1940+
submissionBlockers={submissionBlockers}
1941+
selectedUnblockOptions={{ fast_ach_threshold_exceeded: 'move_to_four_day' }}
1942+
onUnblockOptionChange={action('onUnblockOptionChange')}
1943+
onCancel={action('cancel')}
1944+
onPayrollReceipt={action('payrollReceipt')}
1945+
onPaystubDownload={action('paystubDownload')}
1946+
payrollData={{
1947+
payrollDeadline: new Date('2025-09-24T23:00:00.000Z'),
1948+
checkDate: '2025-09-26',
1949+
processed: false,
1950+
processedDate: null,
1951+
calculatedAt: new Date('2025-09-15T16:25:07.000Z'),
1952+
uuid: '9f2013b1-caa6-4b49-8ae2-abc988615808',
1953+
payrollUuid: '9f2013b1-caa6-4b49-8ae2-abc988615808',
1954+
companyUuid: '624e94a3-da0a-48e1-9f9b-667f8d502ce1',
1955+
offCycle: false,
1956+
autoPilot: false,
1957+
external: false,
1958+
payPeriod: {
1959+
startDate: '2025-09-12',
1960+
endDate: '2025-09-18',
1961+
payScheduleUuid: '3bef2adc-5ffb-4575-94d7-2e34c3e7c0ac',
1962+
},
1963+
totals: {
1964+
companyDebit: '8804.53',
1965+
netPayDebit: '10453.44',
1966+
taxDebit: '4917.37',
1967+
reimbursementDebit: '0.00',
1968+
childSupportDebit: '0.00',
1969+
reimbursements: '0.00',
1970+
netPay: '10453.44',
1971+
grossPay: '13754.60',
1972+
employeeBonuses: '0.00',
1973+
employeeCommissions: '0.00',
1974+
employeeCashTips: '0.00',
1975+
employeePaycheckTips: '0.00',
1976+
additionalEarnings: '0.00',
1977+
ownersDraw: '0.00',
1978+
checkAmount: '0.00',
1979+
employerTaxes: '1616.21',
1980+
employeeTaxes: '3301.16',
1981+
benefits: '0.00',
1982+
employeeBenefitsDeductions: '0.00',
1983+
imputedPay: '0.00',
1984+
deferredPayrollTaxes: '0.00',
1985+
otherDeductions: '0.00',
1986+
},
1987+
companyTaxes: [],
1988+
employeeCompensations: [],
1989+
}}
1990+
bankAccount={{
1991+
uuid: 'bank-uuid',
1992+
name: 'Business Checking',
1993+
hiddenAccountNumber: 'XXXX7235',
1994+
routingNumber: '121000248',
1995+
accountType: 'Checking',
1996+
}}
1997+
employeeDetails={[]}
1998+
/>
1999+
)
2000+
}

src/components/Payroll/PayrollOverview/PayrollOverviewPresentation.test.tsx

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,4 +276,94 @@ describe('PayrollOverviewPresentation', () => {
276276
expect(submitButton).not.toBeDisabled()
277277
})
278278
})
279+
280+
describe('Payroll summary table', () => {
281+
it('displays default payroll summary when no option is selected', async () => {
282+
renderWithProviders(
283+
<PayrollOverviewPresentation
284+
{...defaultProps}
285+
submissionBlockers={[mockFastAchBlocker]}
286+
onUnblockOptionChange={vi.fn()}
287+
/>,
288+
)
289+
290+
await waitFor(() => {
291+
expect(screen.getByText(/Payroll Summary/i)).toBeInTheDocument()
292+
})
293+
expect(screen.getByText(/Debit amount/i)).toBeInTheDocument()
294+
expect(screen.getByText(/Debit account/i)).toBeInTheDocument()
295+
expect(screen.getByText(/Debit date/i)).toBeInTheDocument()
296+
})
297+
298+
it('displays wire funds payroll summary when wire_in is selected', async () => {
299+
renderWithProviders(
300+
<PayrollOverviewPresentation
301+
{...defaultProps}
302+
submissionBlockers={[mockFastAchBlocker]}
303+
selectedUnblockOptions={{ fast_ach_threshold_exceeded: 'wire_in' }}
304+
onUnblockOptionChange={vi.fn()}
305+
/>,
306+
)
307+
308+
await waitFor(() => {
309+
expect(screen.getByText(/Payroll summary \(Wire funds\)/i)).toBeInTheDocument()
310+
})
311+
expect(screen.getByText(/Wire amount/i)).toBeInTheDocument()
312+
expect(screen.getByText(/Wire transfer deadline/i)).toBeInTheDocument()
313+
expect(screen.queryByText(/Debit account/i)).not.toBeInTheDocument()
314+
expect(screen.queryByText(/Debit date/i)).not.toBeInTheDocument()
315+
})
316+
317+
it('displays 4-day direct deposit payroll summary when move_to_four_day is selected', async () => {
318+
renderWithProviders(
319+
<PayrollOverviewPresentation
320+
{...defaultProps}
321+
submissionBlockers={[mockFastAchBlocker]}
322+
selectedUnblockOptions={{ fast_ach_threshold_exceeded: 'move_to_four_day' }}
323+
onUnblockOptionChange={vi.fn()}
324+
/>,
325+
)
326+
327+
await waitFor(() => {
328+
expect(screen.getByText(/Payroll summary \(4-day direct deposit\)/i)).toBeInTheDocument()
329+
})
330+
expect(screen.getByText(/Debit amount/i)).toBeInTheDocument()
331+
expect(screen.getByText(/Debit account/i)).toBeInTheDocument()
332+
expect(screen.getByText(/Debit date/i)).toBeInTheDocument()
333+
})
334+
335+
it('displays correct employee pay date from unblock option for wire funds', async () => {
336+
renderWithProviders(
337+
<PayrollOverviewPresentation
338+
{...defaultProps}
339+
submissionBlockers={[mockFastAchBlocker]}
340+
selectedUnblockOptions={{ fast_ach_threshold_exceeded: 'wire_in' }}
341+
onUnblockOptionChange={vi.fn()}
342+
/>,
343+
)
344+
345+
await waitFor(() => {
346+
expect(screen.getByText(/Payroll summary \(Wire funds\)/i)).toBeInTheDocument()
347+
})
348+
const employeePayDateCells = screen.getAllByText(/Aug 13, 2025/i)
349+
expect(employeePayDateCells.length).toBeGreaterThan(0)
350+
})
351+
352+
it('displays correct employee pay date from unblock option for 4-day direct deposit', async () => {
353+
renderWithProviders(
354+
<PayrollOverviewPresentation
355+
{...defaultProps}
356+
submissionBlockers={[mockFastAchBlocker]}
357+
selectedUnblockOptions={{ fast_ach_threshold_exceeded: 'move_to_four_day' }}
358+
onUnblockOptionChange={vi.fn()}
359+
/>,
360+
)
361+
362+
await waitFor(() => {
363+
expect(screen.getByText(/Payroll summary \(4-day direct deposit\)/i)).toBeInTheDocument()
364+
})
365+
const employeePayDateCells = screen.getAllByText(/Aug 15, 2025/i)
366+
expect(employeePayDateCells.length).toBeGreaterThan(0)
367+
})
368+
})
279369
})

0 commit comments

Comments
 (0)