Skip to content

Commit

Permalink
fix: working on front-end test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
dysmento committed Dec 7, 2023
1 parent 29dd07d commit 41eb266
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import type { CellSuccessProps, CellFailureProps } from '@redwoodjs/web'
export const QUERY = gql`
query FindReportingPeriodQuery($id: Int!) {
reportingPeriod: reportingPeriod(id: $id) {
id
name
}
}
Expand Down
59 changes: 30 additions & 29 deletions web/src/components/ReportingPeriodsCell/ReportingPeriodsCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,37 +42,38 @@ export const Success = ({
<th>Certified At</th>
</tr>
</thead>
<tbody></tbody>
{reportingPeriods.map((item) => {
return (
<tr>
<td>{item.startDate}</td>
<td>{item.endDate}</td>
<td>
{item.inputTemplate.name}
{!item.certifiedAt && (
<span>
{' '}
<Link to={routes.uploadTemplate({ id: item.id })}>
Upload Template
</Link>
</span>
)}
</td>
<td>
{item.isCurrentPeriod ? (
<button>Certify Reporting Period</button>
) : (
item.certifiedAt && (
<tbody>
{reportingPeriods.map((item) => {
return (
<tr key={item.id}>
<td>{item.startDate}</td>
<td>{item.endDate}</td>
<td>
{item.inputTemplate && item.inputTemplate.name}
{!item.certifiedAt && (
<span>
{item.certifiedAt} by {item.certifiedBy}
{' '}
<Link to={routes.uploadTemplate({ id: item.id })}>
Upload Template
</Link>
</span>
)
)}
</td>
</tr>
)
})}
)}
</td>
<td>
{item.isCurrentPeriod ? (
<button>Certify Reporting Period</button>
) : (
item.certifiedAt && (
<span>
{item.certifiedAt} by {item.certifiedBy.email}
</span>
)
)}
</td>
</tr>
)
})}
</tbody>
</table>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import UploadTemplatePage from './UploadTemplatePage'
describe('UploadTemplatePage', () => {
it('renders successfully', () => {
expect(() => {
render(<UploadTemplatePage />)
render(<UploadTemplatePage id="1" />)
}).not.toThrow()
})
})
4 changes: 2 additions & 2 deletions web/types/graphql.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -507,9 +507,9 @@ export type FindReportingPeriodQueryVariables = Exact<{
}>;


export type FindReportingPeriodQuery = { __typename?: 'Query', reportingPeriod?: { __typename?: 'ReportingPeriod', id: number } | null };
export type FindReportingPeriodQuery = { __typename?: 'Query', reportingPeriod?: { __typename?: 'ReportingPeriod', id: number, name: string } | null };

export type ReportingPeriodsQueryVariables = Exact<{ [key: string]: never; }>;


export type ReportingPeriodsQuery = { __typename?: 'Query', reportingPeriods: Array<{ __typename?: 'ReportingPeriod', id: number, startDate: string, endDate: string, isCurrentPeriod: boolean, certifiedAt?: string | null, certifiedBy?: { __typename?: 'User', email: string } | null, inputTemplate: { __typename?: 'InputTemplate', name: string } }> };
export type ReportingPeriodsQuery = { __typename?: 'Query', reportingPeriods: Array<{ __typename?: 'ReportingPeriod', id: number, startDate: string, endDate: string, isCurrentPeriod: boolean, certifiedAt?: string | null, inputTemplate: { __typename?: 'InputTemplate', name: string }, certifiedBy?: { __typename?: 'User', email: string } | null }> };

0 comments on commit 41eb266

Please sign in to comment.