-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor App.test.js to test Work component for current year
- Loading branch information
Showing
1 changed file
with
8 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
import React from 'react'; | ||
import { render, screen } from '@testing-library/react'; | ||
import App from './App'; | ||
//import App from './App'; | ||
import Work from './pages/Work'; | ||
|
||
test('if the copyright is for latest year', () => { | ||
test('if I have at least one project for this year', () => { | ||
const currentYear = new Date().getFullYear().toString() | ||
const { getByText } = render(<App />); | ||
const linkElement = getByText(currentYear, { exact: false }); | ||
expect(linkElement).toBeInTheDocument(); | ||
// const getByTextApp = render(<App />).getByText; | ||
const getByTextWork = render(<Work />).getByText; | ||
// const linkElementApp = getByTextApp(currentYear, { exact: false }); | ||
const linkElementWork = getByTextWork(currentYear, { exact: false }); | ||
expect(linkElementWork).toBeInTheDocument(); | ||
}); |