diff --git a/src/app/work/page.test.tsx b/src/app/work/page.test.tsx index 87e8e04..7be463f 100644 --- a/src/app/work/page.test.tsx +++ b/src/app/work/page.test.tsx @@ -1,7 +1,13 @@ /* * @jest-environment jsdom */ -import { renderWithLayout, screen, renderSnapshotWithLayout } from 'test-utils'; +import { + render, + renderWithLayout, + screen, + renderSnapshotWithLayout, +} from 'test-utils'; +// import userEvent from '@testing-library/user-event'; import WorkPage from './page'; @@ -27,4 +33,49 @@ describe('The Work Page', () => { expect(component).toBeVisible(); } ); + + test('works as expected', () => { + // const user = userEvent.setup(); + + render(); + + const heading = screen.getByRole('heading', { level: 1 }); + expect(heading).toBeVisible(); + expect(heading).toHaveTextContent('Work'); + + const portfolioHeading2 = screen.getByRole('heading', { level: 2 }); + expect(portfolioHeading2).toBeVisible(); + expect(portfolioHeading2).toHaveTextContent( + 'Portfolio Site | Owner, Developer' + ); + + const imperfectTab = screen.getByRole('tab', { name: 'Imperfect Foods' }); + expect(imperfectTab).toBeVisible(); + + // TODO https://github.com/nicholeuf/zen-site-next/issues/30 + // await user.click(imperfectTab); + + // const imperfectHeading2 = screen.getByRole('heading', { level: 2 }); + // expect(imperfectHeading2).toBeVisible(); + // expect(imperfectHeading2).toHaveTextContent( + // 'Portfolio Site | Owner, Developer' + // ); + + // const footer = screen.getByTestId('footer') as HTMLDivElement; + // expect(footer).toBeVisible(); + // expect(footer).toHaveStyleRule('color', '#E8EAE3'); + // expect(footer).toHaveStyleRule('background-color', '#373833'); + + // const nav = screen.getByTestId('footer-nav') as HTMLDivElement; + // expect(nav).toBeVisible(); + + // const madeWithLoveCopy = screen.getByText(/Made with/i); + // expect(madeWithLoveCopy).toBeVisible(); + + // const copyRightCopy = screen.getByText(/Copyright/i); + // expect(copyRightCopy).toBeVisible(); + + // const sourceCopy = screen.getByText(/View Source Code/i); + // expect(sourceCopy).toBeVisible(); + }); });