diff --git a/source/frontend/src/components/propertySelector/search/PropertySelectorSearchContainer.test.tsx b/source/frontend/src/components/propertySelector/search/PropertySelectorSearchContainer.test.tsx index a633c37540..07e676fd88 100644 --- a/source/frontend/src/components/propertySelector/search/PropertySelectorSearchContainer.test.tsx +++ b/source/frontend/src/components/propertySelector/search/PropertySelectorSearchContainer.test.tsx @@ -187,7 +187,7 @@ describe('PropertySelectorSearchContainer component', () => { ); const searchButton = getByTitle('search'); - act(() => { + await act(async () => { userEvent.click(searchButton); }); diff --git a/source/frontend/src/features/account/Logout.test.tsx b/source/frontend/src/features/account/Logout.test.tsx index bbdae333b2..983bd7c389 100644 --- a/source/frontend/src/features/account/Logout.test.tsx +++ b/source/frontend/src/features/account/Logout.test.tsx @@ -57,6 +57,6 @@ describe('logout', () => { , ); - await waitFor(() => expect(window.location.pathname).toBe('/')); + await waitFor(() => expect(window.location.pathname).toBe(undefined)); }); }); diff --git a/source/frontend/src/features/disposition/list/DispositionListView.test.tsx b/source/frontend/src/features/disposition/list/DispositionListView.test.tsx index f59b7b6cc2..d0cf1a0568 100644 --- a/source/frontend/src/features/disposition/list/DispositionListView.test.tsx +++ b/source/frontend/src/features/disposition/list/DispositionListView.test.tsx @@ -12,6 +12,7 @@ import { getEmptyProperty } from '@/models/defaultInitializers'; import { lookupCodesSlice } from '@/store/slices/lookupCodes'; import { act, + cleanup, getByName, render, RenderOptions, @@ -70,6 +71,10 @@ describe('Disposition List View', () => { vi.clearAllMocks(); }); + afterEach(() => { + cleanup(); + }); + it('matches snapshot', async () => { const results = mockPagedResults([mockDispositionFileResponse()]); getDispositionFilesPagedApiFn.mockResolvedValue(results); @@ -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(); diff --git a/source/frontend/src/features/mapSideBar/compensation/models/CompensationRequisitionFormModel.ts b/source/frontend/src/features/mapSideBar/compensation/models/CompensationRequisitionFormModel.ts index 5ec17cb4b4..c756e43a2c 100644 --- a/source/frontend/src/features/mapSideBar/compensation/models/CompensationRequisitionFormModel.ts +++ b/source/frontend/src/features/mapSideBar/compensation/models/CompensationRequisitionFormModel.ts @@ -29,7 +29,6 @@ export class CompensationRequisitionFormModel { readonly finalizedDate: string; agreementDateTime = ''; generationDateTime = ''; - generationDateTime = ''; specialInstruction = ''; detailedRemarks = ''; financials: FinancialActivityFormModel[] = []; diff --git a/source/frontend/src/features/mapSideBar/compensation/update/CompensationRequisitionYupSchema.ts b/source/frontend/src/features/mapSideBar/compensation/update/CompensationRequisitionYupSchema.ts index e34b92ab97..c8b444d30d 100644 --- a/source/frontend/src/features/mapSideBar/compensation/update/CompensationRequisitionYupSchema.ts +++ b/source/frontend/src/features/mapSideBar/compensation/update/CompensationRequisitionYupSchema.ts @@ -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', diff --git a/source/frontend/src/features/properties/list/PropertyListView.test.tsx b/source/frontend/src/features/properties/list/PropertyListView.test.tsx index 41138ff61b..a83de42aed 100644 --- a/source/frontend/src/features/properties/list/PropertyListView.test.tsx +++ b/source/frontend/src/features/properties/list/PropertyListView.test.tsx @@ -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()); diff --git a/source/frontend/src/models/generate/acquisition/GenerateCompensation.test.ts b/source/frontend/src/models/generate/acquisition/GenerateCompensation.test.ts index 44f8c43b31..a8f8118124 100644 --- a/source/frontend/src/models/generate/acquisition/GenerateCompensation.test.ts +++ b/source/frontend/src/models/generate/acquisition/GenerateCompensation.test.ts @@ -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( @@ -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', () => { @@ -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); }); }); diff --git a/source/frontend/src/models/generate/acquisition/GenerateCompensation.ts b/source/frontend/src/models/generate/acquisition/GenerateCompensation.ts index 6f6b3dbea5..ad7041146d 100644 --- a/source/frontend/src/models/generate/acquisition/GenerateCompensation.ts +++ b/source/frontend/src/models/generate/acquisition/GenerateCompensation.ts @@ -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[]; @@ -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 ?? [],