Skip to content

Commit

Permalink
Merge pull request #1072 from MTES-MCT/fix-frontend-housing-test
Browse files Browse the repository at this point in the history
fix: HousingView.test.tsx content assertion
  • Loading branch information
loicguillois authored Jan 6, 2025
2 parents 373ec3e + 7122c38 commit e8abc31
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion frontend/src/views/Housing/test/HousingView.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { render, screen, within } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { Provider } from 'react-redux';
import { createMemoryRouter, RouterProvider } from 'react-router-dom';
import { format, subYears } from 'date-fns';

import {
HousingDTO,
Expand Down Expand Up @@ -86,7 +87,7 @@ describe('Housing view', () => {
const vacancyStartYear = await screen
.findByText(/^Dans cette situation depuis/)
.then((label) => label.nextElementSibling);
expect(vacancyStartYear).toHaveTextContent('Moins d’un an');
expect(vacancyStartYear).toHaveTextContent(`1 an (${format(subYears(new Date(), 1), 'yyyy')})`);
});
});

Expand Down

0 comments on commit e8abc31

Please sign in to comment.