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 @@ -4,6 +4,7 @@ import {
render,
screen,
waitFor,
within,
} from '@testing-library/react'

import { Winning } from '../../models/WinningDetail'
Expand Down Expand Up @@ -122,15 +123,31 @@ describe('PaymentView', () => {

expect(await screen.findByRole('heading', { name: 'Engagement Details' }))
.toBeTruthy()
expect(await screen.findByText('copilot-manager'))
.toBeTruthy()
await waitFor(() => {
expect(screen.getAllByText('43.75'))
.toHaveLength(2)
})
expect(await screen.findByText(/Completed sprint support and bug triage\./))
.toBeTruthy()

const workLogHeading = await screen.findByRole('heading', {
name: 'Work Log / Manager Inputs',
})
const workLogSection = workLogHeading.parentElement

if (!workLogSection) {
throw new Error('Expected work log section to be rendered.')
}

expect(screen.getAllByText('Payment Creator'))
.toHaveLength(1)
expect(within(workLogSection)
.getByText('Payment Creator'))
.toBeTruthy()
expect(within(workLogSection)
.getByText('copilot-manager'))
.toBeTruthy()

const descriptionLink = await screen.findByRole('link', {
name: 'Wipro - US Foods - Week Ending: Mar 21, 2026',
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,17 +164,6 @@ const PaymentView: React.FC<PaymentViewProps> = (props: PaymentViewProps) => {
<span className={styles.label}>Handle</span>
<p className={styles.value}>{props.payment.handle}</p>
</div>
{isEngagementPayment && (
<div className={styles.infoItem}>
<span className={styles.label}>Payment Creator</span>
<p className={styles.value}>
{isPaymentDetailsLoading
? 'Loading...'
: formatOptionalText(paymentDetails?.paymentCreatorHandle)}
</p>
</div>
)}

<div className={styles.infoItem}>
<span className={styles.label}>Type</span>
<p className={styles.value}>{props.payment.type}</p>
Expand Down Expand Up @@ -306,6 +295,12 @@ const PaymentView: React.FC<PaymentViewProps> = (props: PaymentViewProps) => {
{renderOptionalLinkedText(paymentDetails?.workLog?.remarks)}
</p>
</div>
<div className={styles.infoItem}>
<span className={styles.label}>Payment Creator</span>
<p className={styles.value}>
{formatOptionalText(paymentDetails?.paymentCreatorHandle)}
</p>
</div>
</div>
)}
</div>
Expand Down
Loading