diff --git a/.github/workflows/e2e-ci.yml b/.github/workflows/e2e-ci.yml
new file mode 100644
index 0000000..d5bb769
--- /dev/null
+++ b/.github/workflows/e2e-ci.yml
@@ -0,0 +1,15 @@
+name: "Tests: E2E"
+on: [pull_request]
+jobs:
+ tests_e2e:
+ name: Run end-to-end tests
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - uses: actions/setup-node@v3
+ - name: install dependencies
+ run: npm ci
+ - name: install playwright browsers
+ run: npx playwright install --with-deps
+ - name: npm run test:e2e
+ run: npm run test:e2e
diff --git a/.gitignore b/.gitignore
index 1437c53..0a7ad7a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -32,3 +32,13 @@ yarn-error.log*
# vercel
.vercel
+
+## IDE's
+.idea/
+
+.vscode/*
+!.vscode/settings.json
+!.vscode/tasks.json
+!.vscode/launch.json
+!.vscode/extensions.json
+!.vscode/*.code-snippets
diff --git a/.idea/.gitignore b/.idea/.gitignore
deleted file mode 100644
index 73f69e0..0000000
--- a/.idea/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-# Default ignored files
-/shelf/
-/workspace.xml
-# Datasource local storage ignored files
-/dataSources/
-/dataSources.local.xml
-# Editor-based HTTP Client requests
-/httpRequests/
diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml
deleted file mode 100644
index bfcfff7..0000000
--- a/.idea/checkstyle-idea.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml
deleted file mode 100644
index a55e7a1..0000000
--- a/.idea/codeStyles/codeStyleConfig.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
deleted file mode 100644
index ad03785..0000000
--- a/.idea/misc.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
diff --git a/.idea/modules.xml b/.idea/modules.xml
deleted file mode 100644
index 8020e3a..0000000
--- a/.idea/modules.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/pull-request-community.iml b/.idea/pull-request-community.iml
deleted file mode 100644
index d6ebd48..0000000
--- a/.idea/pull-request-community.iml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
deleted file mode 100644
index 35eb1dd..0000000
--- a/.idea/vcs.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/README.md b/README.md
index 8edef0a..2ac25a2 100644
--- a/README.md
+++ b/README.md
@@ -58,7 +58,11 @@ You can add / update your personal profile by creating a Pull Request to this re
and anything that you are passionate about. Are you an architect? Do you speak Chinese? Studied amusement park
and roller coaster engineering? This is the place to brag!
-2. By default, we'll use your GitHub photo. There's currently an [open issue](https://github.com/urish/pull-request-community/issues/78) to allow custom profile photos.
+2. By default, we'll use your GitHub photo. If you don't have a GitHub profile photo,
+ or want to use a different one, add it under [public/images/people](public/images/people) in jpeg format.
+ Use your GitHub username for the image, e.g. `MichalPorag.jpg`.
+
+ Then, add `"customImage": true` to your profile JSON that you created in the previous step.
3. Create a pull request with new files.
diff --git a/components/description/Description.tsx b/components/description/Description.tsx
index f6d063e..58b1515 100644
--- a/components/description/Description.tsx
+++ b/components/description/Description.tsx
@@ -6,7 +6,9 @@ const Description = ({ descriptionOutput, descriptionHeight }) => {
const myRef = useRef(null);
const [height, setHeight] = useState(0);
- descriptionHeight(height);
+ useEffect(() => {
+ descriptionHeight(height);
+ }, [descriptionHeight, height]);
useEffect(() => {
const handleResize = () => {
diff --git a/components/label/label.module.scss b/components/label/label.module.scss
index 54bcc46..45c737f 100644
--- a/components/label/label.module.scss
+++ b/components/label/label.module.scss
@@ -11,6 +11,9 @@
&[role="Admin"] {
background: cornflowerblue;
}
+ &[role="Former admin"] {
+ background: cadetblue;
+ }
@media screen and (max-width: 600px) {
font-size: 10px;
diff --git a/e2e/home.spec.ts b/e2e/home.spec.ts
new file mode 100644
index 0000000..7362739
--- /dev/null
+++ b/e2e/home.spec.ts
@@ -0,0 +1,8 @@
+import { test, expect } from '@playwright/test'
+
+test('page should have title of "קהילת Pull Request"', async ({page}) => {
+ await page.goto('http://localhost:3000/')
+ const title = await page.title()
+ expect(title).toBe('קהילת Pull Request')
+});
+
diff --git a/package-lock.json b/package-lock.json
index b9f3ad7..ccda812 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -19,6 +19,7 @@
"uuid": "^8.3.2"
},
"devDependencies": {
+ "@playwright/test": "^1.22.2",
"@types/node": "^14.11.2",
"@types/react": "^16.9.50",
"eslint": "^7.32.0",
@@ -1006,6 +1007,22 @@
"node": ">= 8"
}
},
+ "node_modules/@playwright/test": {
+ "version": "1.22.2",
+ "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.22.2.tgz",
+ "integrity": "sha512-cCl96BEBGPtptFz7C2FOSN3PrTnJ3rPpENe+gYCMx4GNNDlN4tmo2D89y13feGKTMMAIVrXfSQ/UmaQKLy1XLA==",
+ "dev": true,
+ "dependencies": {
+ "@types/node": "*",
+ "playwright-core": "1.22.2"
+ },
+ "bin": {
+ "playwright": "cli.js"
+ },
+ "engines": {
+ "node": ">=14"
+ }
+ },
"node_modules/@rushstack/eslint-patch": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.1.3.tgz",
@@ -5280,6 +5297,18 @@
"resolved": "https://registry.npmjs.org/platform/-/platform-1.3.6.tgz",
"integrity": "sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg=="
},
+ "node_modules/playwright-core": {
+ "version": "1.22.2",
+ "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.22.2.tgz",
+ "integrity": "sha512-w/hc/Ld0RM4pmsNeE6aL/fPNWw8BWit2tg+TfqJ3+p59c6s3B6C8mXvXrIPmfQEobkcFDc+4KirNzOQ+uBSP1Q==",
+ "dev": true,
+ "bin": {
+ "playwright": "cli.js"
+ },
+ "engines": {
+ "node": ">=14"
+ }
+ },
"node_modules/please-upgrade-node": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz",
@@ -7532,6 +7561,16 @@
"fastq": "^1.6.0"
}
},
+ "@playwright/test": {
+ "version": "1.22.2",
+ "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.22.2.tgz",
+ "integrity": "sha512-cCl96BEBGPtptFz7C2FOSN3PrTnJ3rPpENe+gYCMx4GNNDlN4tmo2D89y13feGKTMMAIVrXfSQ/UmaQKLy1XLA==",
+ "dev": true,
+ "requires": {
+ "@types/node": "*",
+ "playwright-core": "1.22.2"
+ }
+ },
"@rushstack/eslint-patch": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.1.3.tgz",
@@ -10766,6 +10805,12 @@
"resolved": "https://registry.npmjs.org/platform/-/platform-1.3.6.tgz",
"integrity": "sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg=="
},
+ "playwright-core": {
+ "version": "1.22.2",
+ "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.22.2.tgz",
+ "integrity": "sha512-w/hc/Ld0RM4pmsNeE6aL/fPNWw8BWit2tg+TfqJ3+p59c6s3B6C8mXvXrIPmfQEobkcFDc+4KirNzOQ+uBSP1Q==",
+ "dev": true
+ },
"please-upgrade-node": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz",
diff --git a/package.json b/package.json
index 667f33c..c77f7a9 100644
--- a/package.json
+++ b/package.json
@@ -6,9 +6,10 @@
"dev": "npm run open-browser && next dev",
"open-browser": "node ./scripts/open-browser.js",
"build": "next build",
- "start": "next start",
+ "start": "npm run build && next start",
"prepare": "husky install",
- "lint": "next lint"
+ "lint": "next lint",
+ "test:e2e": "playwright test"
},
"dependencies": {
"@mdi/js": "^5.6.55",
@@ -22,6 +23,7 @@
"uuid": "^8.3.2"
},
"devDependencies": {
+ "@playwright/test": "^1.22.2",
"@types/node": "^14.11.2",
"@types/react": "^16.9.50",
"eslint": "^7.32.0",
diff --git a/pages/index.tsx b/pages/index.tsx
index 94e8949..b53a2b8 100644
--- a/pages/index.tsx
+++ b/pages/index.tsx
@@ -30,5 +30,6 @@ export const getStaticProps: GetStaticProps = async () => {
props: {
people: randomShuffle(getPeople()),
},
+ revalidate: true,
};
};
diff --git a/playwright.config.ts b/playwright.config.ts
new file mode 100644
index 0000000..1a927d3
--- /dev/null
+++ b/playwright.config.ts
@@ -0,0 +1,10 @@
+import { PlaywrightTestConfig } from "@playwright/test";
+
+const config: PlaywrightTestConfig = {
+ webServer: {
+ command: "npm run start",
+ url: "http://localhost:3000",
+ }
+};
+
+export default config;
\ No newline at end of file