Skip to content

Commit

Permalink
🧪 test(footer): turn current year dynamic in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
allbertuu committed Jan 15, 2025
1 parent 98158e7 commit 95ff5e0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/Footer/Footer.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,15 @@ test('renders correctly', () => {

test('renders Author rights', () => {
const domain = 'albertosantos.dev';
const currentYear = new Date().getFullYear();
render(<Footer />);

expect(screen.getByText(domain)).toBeInTheDocument();
expect(screen.getByText(/2024 - todos os direitos reservados/i));
expect(
screen.getByText(
new RegExp(`${currentYear} - todos os direitos reservados`, 'i')
)
).toBeInTheDocument();
});

test('renders Powered by and logo', () => {
Expand Down

0 comments on commit 95ff5e0

Please sign in to comment.