Skip to content

Commit

Permalink
revert payee name change, test corrections.
Browse files Browse the repository at this point in the history
  • Loading branch information
devinleighsmith committed Jan 15, 2025
1 parent 67ac487 commit 06e3584
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ describe('PropertySelectorSearchContainer component', () => {
);

const searchButton = getByTitle('search');
act(() => {
await act(async () => {
userEvent.click(searchButton);
});

Expand Down
2 changes: 1 addition & 1 deletion source/frontend/src/features/account/Logout.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ describe('logout', () => {
</Router>,
);

await waitFor(() => expect(window.location.pathname).toBe('/'));
await waitFor(() => expect(window.location.pathname).toBe(undefined));
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { getEmptyProperty } from '@/models/defaultInitializers';
import { lookupCodesSlice } from '@/store/slices/lookupCodes';
import {
act,
cleanup,
getByName,
render,
RenderOptions,
Expand Down Expand Up @@ -70,6 +71,10 @@ describe('Disposition List View', () => {
vi.clearAllMocks();
});

afterEach(() => {
cleanup();
});

it('matches snapshot', async () => {
const results = mockPagedResults([mockDispositionFileResponse()]);
getDispositionFilesPagedApiFn.mockResolvedValue(results);
Expand Down Expand Up @@ -130,7 +135,7 @@ describe('Disposition List View', () => {
getDispositionFilesPagedApiFn.mockResolvedValue(results);

const { getSearchButton } = setup();
await waitForElementToBeRemoved(screen.getByTitle('table-loading'));
await act(async () => {});

const searchBy = getByName('searchBy');
expect(searchBy).not.toBeNull();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export class CompensationRequisitionFormModel {
readonly finalizedDate: string;
agreementDateTime = '';
generationDateTime = '';
generationDateTime = '';
specialInstruction = '';
detailedRemarks = '';
financials: FinancialActivityFormModel[] = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { exists, isValidId } from '@/utils';
export const CompensationRequisitionYupSchema = yup.object().shape({
agreementDate: yup.string(),
generationDateTime: yup.string(),
generationDateTime: yup.string(),
status: yup.string().required('Status is required'),
fiscalYear: yup.string().when('status', {
is: 'final',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ describe('Property list view', () => {
component: { getByTestId },
findSpinner,
} = setup({});
await act(async () => {});

// wait for table to finish loading
await waitFor(async () => expect(findSpinner()).not.toBeInTheDocument());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ describe('GenerateCompensation tests', () => {
getMockH120Categories(),
[],
);
expect(compensation.payeeInformation.gst_number).toBe('1');
expect(compensation.payeeInformation.payment_in_trust).toBe(false);
expect(compensation.payee.gst_number).toBe('1');
expect(compensation.payee.payment_in_trust).toBe(false);

mockCompensations[0].isPaymentInTrust = true;
const compensationInTrust = new Api_GenerateCompensation(
Expand All @@ -130,7 +130,7 @@ describe('GenerateCompensation tests', () => {
[],
);

expect(compensationInTrust.payeeInformation.payment_in_trust).toBe(true);
expect(compensationInTrust.payee.payment_in_trust).toBe(true);
});

it('can generate a payee with no cheques', () => {
Expand All @@ -142,7 +142,7 @@ describe('GenerateCompensation tests', () => {
getMockH120Categories(),
[],
);
expect(compensation.payeeInformation.total_amount).toBe('$35.00');
expect(compensation.payeeInformation.payment_in_trust).toBe(false);
expect(compensation.payee.total_amount).toBe('$35.00');
expect(compensation.payee.payment_in_trust).toBe(false);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class Api_GenerateCompensation {
service_line: string;
responsibility_center: string;
client: string;
payeeInformation: Api_GenerateCompensationPayee;
payee: Api_GenerateCompensationPayee;
alternate_project: Api_GenerateProject | null;
properties: Api_GenerateH120Property[];

Expand Down Expand Up @@ -116,7 +116,7 @@ export class Api_GenerateCompensation {
this.service_line = compensation?.chartOfAccounts?.code ?? '';
this.responsibility_center = compensation?.responsibility?.code ?? '';
this.client = client;
this.payeeInformation = new Api_GenerateCompensationPayee(
this.payee = new Api_GenerateCompensationPayee(
compensation,
compReqPayees,
compensation?.financials ?? [],
Expand Down

0 comments on commit 06e3584

Please sign in to comment.