Skip to content

Commit

Permalink
refactor(tests): setup basic e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
teo-garcia committed Sep 19, 2024
1 parent ad1403a commit a35e29a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![README.md banner](./README.png)
<!-- ![README.md banner](./README.png) -->

![Package License](https://img.shields.io/github/license/teo-garcia/react-template-next)
![Package Version](https://img.shields.io/github/package-json/v/teo-garcia/react-template-next)
Expand Down
11 changes: 4 additions & 7 deletions e2e/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,13 @@ test.describe('Homepage tests', () => {
await page.goto('http://localhost:3000/')
})

test('Homepage should contain title', async ({ page }) => {
await expect(page).toHaveTitle('Home | Next 13')
test('Page should contain title', async ({ page }) => {
await expect(page).toHaveTitle('Home | RTN')
})

test('Homepage should contain heading', async ({ page }) => {
// eslint-disable-next-line testing-library/prefer-screen-queries
test('Page should contain heading', async ({ page }) => {
// eslint-disable-next-line
const title = page.getByRole('heading', { name: 'React Template Next' })
await expect(title).toBeVisible()
})

// TODO: Add ThemeSwitch tests
// TODO: Improve test matcher config and ESLint plugins
})
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"create:component": "plop component",
"create:feature": "plop feature",
"test:unit": "jest",
"test:e2e": "concurrently \"pnpm dev\" \"pnpm playwright test\"",
"test:e2e": "pnpm playwright test --ui",
"lint:js": "eslint src/**/*.{ts,tsx}"
},
"dependencies": {
Expand Down

0 comments on commit a35e29a

Please sign in to comment.