Skip to content

Commit

Permalink
commit partial test
Browse files Browse the repository at this point in the history
To be completed in #30
  • Loading branch information
nicholeuf committed Feb 19, 2024
1 parent dcbbffd commit 4feea6e
Showing 1 changed file with 52 additions and 1 deletion.
53 changes: 52 additions & 1 deletion src/app/work/page.test.tsx
Original file line number Diff line number Diff line change
@@ -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';

Expand All @@ -27,4 +33,49 @@ describe('The Work Page', () => {
expect(component).toBeVisible();
}
);

test('works as expected', () => {
// const user = userEvent.setup();

render(<WorkPage />);

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();
});
});

0 comments on commit 4feea6e

Please sign in to comment.