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 @@ -76,7 +76,7 @@ export const buildSalaryBreakdownRows = (
{
id: 'gross-monthly-pay',
category: t('Gross Monthly Pay'),
formula: t('Monthly Base × {{rate}}', {
formula: t('Monthly Base × Geographic Multiplier ({{rate}})', {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Suggestion] Run `yarn extract` after this PR to register the new translation key `'Monthly Base × Geographic Multiplier ({{rate}})'` in `public/locales/`. The prior key (`'Monthly Base × {{rate}}'`) will become orphaned and CrowdIn translators won't see the new string until extraction is run and uploaded. Flagged by: Testing Agent, Architecture Agent.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Suggestion] The `gross-monthly-pay` formula string has no test assertion in `salaryBreakdown.test.tsx` — existing tests only check `row.id` and `row.amount`. All current test fixtures also use `geographicMultiplier: 0`, so the `{{rate}}` interpolation path is untested. Consider adding:
it('labels gross monthly pay with the geographic multiplier formula', () => {
  const rows = buildSalaryBreakdownRows(
    { ...salariedCalculation },
    { geographicMultiplier: 0.1, employerFicaRate: 0.08 },
    'en-US',
    i18n.t,
  );
  const gross = rows.find((r) => r.id === 'gross-monthly-pay');
  expect(gross?.formula).toBe('Monthly Base × Geographic Multiplier (110%)');
});

Flagged by: Testing Agent, UX Agent.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Suggestion] Copy note: `percentageFormat(1 + geographicMultiplier)` formats the *total factor* (e.g. 120% for a 20% geographic add-on), not the add-on rate itself. The rendered label will read "Monthly Base × Geographic Multiplier (120%)". Confirm this is the intended framing — a reader might expect "Geographic Multiplier" to represent the 20% add-on rather than the 120% total factor. Flagged by: Standards Agent, Testing Agent.

rate: percentageFormat(1 + geographicMultiplier, locale),
}),
amount: grossMonthlyPay,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,29 +277,26 @@ describe('StaffExpenseReport', () => {
});

it('shows month title and navigation when only category filters are applied', async () => {
const { getByRole, findByRole, findByLabelText, queryByText } = render(
const { getByRole, findByLabelText, findByRole } = render(
<TestComponent />,
);

userEvent.click(getByRole('button', { name: 'Filter Settings' }));

userEvent.click(await findByLabelText('Assessment'));
userEvent.click(await findByRole('button', { name: 'Apply Filters' }));
await waitFor(() =>
expect(getByRole('button', { name: 'Apply Filters' })).not.toBeDisabled(),
);
userEvent.click(getByRole('button', { name: 'Apply Filters' }));

expect(
await findByRole('heading', { name: 'January 2020', level: 6 }),
).toBeInTheDocument();
expect(
await findByRole('button', { name: 'Previous Month' }),
).toBeInTheDocument();
expect(
await findByRole('button', { name: 'Next Month' }),
).toBeInTheDocument();
expect(queryByText('Clear Filters')).not.toBeInTheDocument();
});
expect(getByRole('button', { name: 'Previous Month' })).toBeInTheDocument();
expect(getByRole('button', { name: 'Next Month' })).toBeInTheDocument();
}, 10000);

it('shows filter date range title and hides month navigation when date filters are applied', async () => {
const originalNow = Settings.now;
Settings.now = () => new Date(2020, 0, 20).valueOf();

const { getByRole, findByRole, getByLabelText, queryByRole } = render(
Expand Down Expand Up @@ -330,7 +327,5 @@ describe('StaffExpenseReport', () => {
expect(
queryByRole('button', { name: 'Next Month' }),
).not.toBeInTheDocument();

Settings.now = originalNow;
}, 10000);
});
Loading