From f418fd7eb27c01e24cd6656f60eae7c660ec445e Mon Sep 17 00:00:00 2001 From: muriukialex Date: Wed, 14 Feb 2024 21:56:54 +0300 Subject: [PATCH 01/22] remove uninstalled dotenv pkg --- package-lock.json | 12 ------------ package.json | 1 - 2 files changed, 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index b4f0f3a..a7634f1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,6 @@ "version": "0.1.0", "dependencies": { "axios": "^1.6.7", - "dotenv": "^16.4.1", "mongoose": "^8.1.1", "next": "14.1.0", "next-auth": "^4.24.5", @@ -1381,17 +1380,6 @@ "node": ">=6.0.0" } }, - "node_modules/dotenv": { - "version": "16.4.1", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.1.tgz", - "integrity": "sha512-CjA3y+Dr3FyFDOAMnxZEGtnW9KBR2M0JvvUtXNW+dYJL5ROWxP9DUHCwgFqpMk0OXCc0ljhaNTr2w/kutYIcHQ==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/motdotla/dotenv?sponsor=1" - } - }, "node_modules/eastasianwidth": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", diff --git a/package.json b/package.json index 399479b..a7d82c2 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,6 @@ }, "dependencies": { "axios": "^1.6.7", - "dotenv": "^16.4.1", "mongoose": "^8.1.1", "next": "14.1.0", "next-auth": "^4.24.5", From 7119f5841f51e1ac74bace210d78450bfae5a19f Mon Sep 17 00:00:00 2001 From: muriukialex Date: Wed, 14 Feb 2024 22:11:52 +0300 Subject: [PATCH 02/22] add GitHub workflow file --- .github/workflows/preview.yaml | 39 +++++++++++++++++++++++++++++++ .github/workflows/production.yaml | 39 +++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 .github/workflows/preview.yaml create mode 100644 .github/workflows/production.yaml diff --git a/.github/workflows/preview.yaml b/.github/workflows/preview.yaml new file mode 100644 index 0000000..9775c83 --- /dev/null +++ b/.github/workflows/preview.yaml @@ -0,0 +1,39 @@ +name: AWS R/Start Labs Preview Deployment +env: + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} + VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} +on: + push: + branches-ignore: + - main +jobs: + Test: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Use Node.js + uses: actions/setup-node@v2 + with: + node-version: 18.12.1 + - name: Clear npm cache + run: npm cache clean -f + - name: Delete node_modules and package-lock.json + run: | + rm -rf node_modules + rm package-lock.json + - name: Install Dependencies + run: npm install + + Deploy-Preview: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install Vercel CLI + run: npm install --global vercel@latest + - name: Pull Vercel Environment Information + run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }} + - name: Build Project Artifacts + run: vercel build --token=${{ secrets.VERCEL_TOKEN }} + - name: Deploy Project Artifacts to Vercel + run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }} diff --git a/.github/workflows/production.yaml b/.github/workflows/production.yaml new file mode 100644 index 0000000..00f7a9a --- /dev/null +++ b/.github/workflows/production.yaml @@ -0,0 +1,39 @@ +name: AWS R/Start Labs Production Deployment +env: + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} + VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} +on: + push: + branches: + - main +jobs: + Test: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Use Node.js + uses: actions/setup-node@v2 + with: + node-version: 18.12.1 + - name: Clear npm cache + run: npm cache clean -f + - name: Delete node_modules and package-lock.json + run: | + rm -rf node_modules + rm package-lock.json + - name: Install Dependencies + run: npm install + + Deploy-Production: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install Vercel CLI + run: npm install --global vercel@latest + - name: Pull Vercel Environment Information + run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} + - name: Build Project Artifacts + run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }} + - name: Deploy Project Artifacts to Vercel + run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }} From b33c0352241e4881ee97add6966e191e5619e8cb Mon Sep 17 00:00:00 2001 From: muriukialex Date: Fri, 16 Feb 2024 00:38:43 +0300 Subject: [PATCH 03/22] add sign in page test, google site verification --- .env.example | 3 +- .github/workflows/preview.yaml | 2 +- .github/workflows/production.yaml | 2 +- .gitignore | 1 + app/home/page.tsx | 1 + app/layout.tsx | 4 +- app/page.tsx | 2 +- components/UI/Lab.tsx | 1 + cypress.config.ts | 11 + cypress/e2e/1-getting-started/todo.cy.js | 143 ++ cypress/e2e/2-advanced-examples/actions.cy.js | 299 +++ .../e2e/2-advanced-examples/aliasing.cy.js | 39 + .../e2e/2-advanced-examples/assertions.cy.js | 176 ++ .../e2e/2-advanced-examples/connectors.cy.js | 98 + cypress/e2e/2-advanced-examples/cookies.cy.js | 118 + .../e2e/2-advanced-examples/cypress_api.cy.js | 185 ++ cypress/e2e/2-advanced-examples/files.cy.js | 85 + .../e2e/2-advanced-examples/location.cy.js | 32 + cypress/e2e/2-advanced-examples/misc.cy.js | 104 + .../e2e/2-advanced-examples/navigation.cy.js | 56 + .../network_requests.cy.js | 163 ++ .../e2e/2-advanced-examples/querying.cy.js | 114 + .../spies_stubs_clocks.cy.js | 201 ++ cypress/e2e/2-advanced-examples/storage.cy.js | 110 + .../e2e/2-advanced-examples/traversal.cy.js | 121 + .../e2e/2-advanced-examples/utilities.cy.js | 108 + .../e2e/2-advanced-examples/viewport.cy.js | 58 + cypress/e2e/2-advanced-examples/waiting.cy.js | 30 + cypress/e2e/2-advanced-examples/window.cy.js | 22 + cypress/e2e/labs/labs.cy.js | 69 + cypress/e2e/sign-in/sign-in.cy.js | 29 + cypress/fixtures/example.json | 5 + cypress/fixtures/profile.json | 5 + cypress/fixtures/users.json | 232 ++ ...and set configuration options (failed).png | Bin 0 -> 123566 bytes .../misc.cy.js/my-image.png | Bin 0 -> 167465 bytes ...status update is unsuccessful (failed).png | Bin 0 -> 78413 bytes ... lab tracking is unsuccessful (failed).png | Bin 0 -> 74694 bytes ... can successfully track a lab (failed).png | Bin 0 -> 56225 bytes ...cessfully update a lab status (failed).png | Bin 0 -> 68650 bytes cypress/support/commands.ts | 37 + cypress/support/e2e.ts | 20 + lib/const.ts | 9 + lib/metadata-options.ts | 53 + package-lock.json | 2223 ++++++++++++++++- package.json | 8 +- public/aws-restart-logo.png | Bin 0 -> 9389 bytes tsconfig.json | 1 + 48 files changed, 4959 insertions(+), 21 deletions(-) create mode 100644 cypress.config.ts create mode 100644 cypress/e2e/1-getting-started/todo.cy.js create mode 100644 cypress/e2e/2-advanced-examples/actions.cy.js create mode 100644 cypress/e2e/2-advanced-examples/aliasing.cy.js create mode 100644 cypress/e2e/2-advanced-examples/assertions.cy.js create mode 100644 cypress/e2e/2-advanced-examples/connectors.cy.js create mode 100644 cypress/e2e/2-advanced-examples/cookies.cy.js create mode 100644 cypress/e2e/2-advanced-examples/cypress_api.cy.js create mode 100644 cypress/e2e/2-advanced-examples/files.cy.js create mode 100644 cypress/e2e/2-advanced-examples/location.cy.js create mode 100644 cypress/e2e/2-advanced-examples/misc.cy.js create mode 100644 cypress/e2e/2-advanced-examples/navigation.cy.js create mode 100644 cypress/e2e/2-advanced-examples/network_requests.cy.js create mode 100644 cypress/e2e/2-advanced-examples/querying.cy.js create mode 100644 cypress/e2e/2-advanced-examples/spies_stubs_clocks.cy.js create mode 100644 cypress/e2e/2-advanced-examples/storage.cy.js create mode 100644 cypress/e2e/2-advanced-examples/traversal.cy.js create mode 100644 cypress/e2e/2-advanced-examples/utilities.cy.js create mode 100644 cypress/e2e/2-advanced-examples/viewport.cy.js create mode 100644 cypress/e2e/2-advanced-examples/waiting.cy.js create mode 100644 cypress/e2e/2-advanced-examples/window.cy.js create mode 100644 cypress/e2e/labs/labs.cy.js create mode 100644 cypress/e2e/sign-in/sign-in.cy.js create mode 100644 cypress/fixtures/example.json create mode 100644 cypress/fixtures/profile.json create mode 100644 cypress/fixtures/users.json create mode 100644 cypress/screenshots/2-advanced-examples/cypress_api.cy.js/Cypress APIs -- Cypress.config() -- Get and set configuration options (failed).png create mode 100644 cypress/screenshots/2-advanced-examples/misc.cy.js/my-image.png create mode 100644 cypress/screenshots/labs/labs.cy.js/User Labs -- can show an error if lab status update is unsuccessful (failed).png create mode 100644 cypress/screenshots/labs/labs.cy.js/User Labs -- can show an error if lab tracking is unsuccessful (failed).png create mode 100644 cypress/screenshots/labs/labs.cy.js/User Labs -- can successfully track a lab (failed).png create mode 100644 cypress/screenshots/labs/labs.cy.js/User Labs -- can successfully update a lab status (failed).png create mode 100644 cypress/support/commands.ts create mode 100644 cypress/support/e2e.ts create mode 100644 lib/metadata-options.ts create mode 100644 public/aws-restart-logo.png diff --git a/.env.example b/.env.example index 2343cae..48453f2 100644 --- a/.env.example +++ b/.env.example @@ -3,4 +3,5 @@ GOOGLE_SECRET_ID= GOOGLE_CLIENT_ID= NEXTAUTH_SECRET= NEXTAUTH_URL= -MONGODB_URI= \ No newline at end of file +MONGODB_URI= +GOOGLE_SITE_VERIFICATION_ID= \ No newline at end of file diff --git a/.github/workflows/preview.yaml b/.github/workflows/preview.yaml index 9775c83..41726ff 100644 --- a/.github/workflows/preview.yaml +++ b/.github/workflows/preview.yaml @@ -7,7 +7,7 @@ on: branches-ignore: - main jobs: - Test: + Run Tests: runs-on: ubuntu-latest steps: - name: Checkout code diff --git a/.github/workflows/production.yaml b/.github/workflows/production.yaml index 00f7a9a..9cb880a 100644 --- a/.github/workflows/production.yaml +++ b/.github/workflows/production.yaml @@ -7,7 +7,7 @@ on: branches: - main jobs: - Test: + Run Tests: runs-on: ubuntu-latest steps: - name: Checkout code diff --git a/.gitignore b/.gitignore index fd3dbb5..e995c1b 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,7 @@ yarn-error.log* # local env files .env*.local +*.env*.json # vercel .vercel diff --git a/app/home/page.tsx b/app/home/page.tsx index cbfe36d..d97d3e5 100644 --- a/app/home/page.tsx +++ b/app/home/page.tsx @@ -39,6 +39,7 @@ const HomePage = () => {
@@ -41,7 +53,7 @@ const UserLabs = ({ return (
-
+

Week 1

{weekOne.map((lab) => ( -
+

Week 2

{weekTwo.map((lab) => ( -
+

Week 3

{weekThree.map((lab) => ( -
+

Week 4

{weekFour.map((lab) => ( -
+

Week 5

{weekFive.map((lab) => ( -
+

Week 6

{weekSix.map((lab) => ( -
+

Week 7

{weekSeven.map((lab) => ( -
+

Week 8

{weekEight.map((lab) => ( -
+

Week 9

{weekNine.map((lab) => ( -
+

Week 10

{weekTen.map((lab) => ( -
+

Week 11

{weekEleven.map((lab) => ( ))}
-
) } diff --git a/components/index.ts b/components/index.ts index 97e3e3f..aa3b87e 100644 --- a/components/index.ts +++ b/components/index.ts @@ -1,4 +1,4 @@ -import { GoogleIcon, CheckMark } from "./Icons" +import { CheckMark, GoogleIcon } from "./Icons" import { Divider, UserLabs } from "./UI" -export { GoogleIcon, Divider, CheckMark, UserLabs } +export { CheckMark, Divider, GoogleIcon, UserLabs } diff --git a/cypress/e2e/1-getting-started/todo.cy.js b/cypress/e2e/1-getting-started/todo.cy.js index 4768ff9..d4516b2 100644 --- a/cypress/e2e/1-getting-started/todo.cy.js +++ b/cypress/e2e/1-getting-started/todo.cy.js @@ -11,32 +11,32 @@ // please read our getting started guide: // https://on.cypress.io/introduction-to-cypress -describe('example to-do app', () => { +describe("example to-do app", () => { beforeEach(() => { // Cypress starts out with a blank slate for each test // so we must tell it to visit our website with the `cy.visit()` command. // Since we want to visit the same URL at the start of all our tests, // we include it in our beforeEach function so that it runs before each test - cy.visit('https://example.cypress.io/todo') + cy.visit("https://example.cypress.io/todo") }) - it('displays two todo items by default', () => { + it("displays two todo items by default", () => { // We use the `cy.get()` command to get all elements that match the selector. // Then, we use `should` to assert that there are two matched items, // which are the two default items. - cy.get('.todo-list li').should('have.length', 2) + cy.get(".todo-list li").should("have.length", 2) // We can go even further and check that the default todos each contain // the correct text. We use the `first` and `last` functions // to get just the first and last matched elements individually, // and then perform an assertion with `should`. - cy.get('.todo-list li').first().should('have.text', 'Pay electric bill') - cy.get('.todo-list li').last().should('have.text', 'Walk the dog') + cy.get(".todo-list li").first().should("have.text", "Pay electric bill") + cy.get(".todo-list li").last().should("have.text", "Walk the dog") }) - it('can add new todo items', () => { + it("can add new todo items", () => { // We'll store our item text in a variable so we can reuse it - const newItem = 'Feed the cat' + const newItem = "Feed the cat" // Let's get the input element and use the `type` command to // input our new list item. After typing the content of our item, @@ -44,29 +44,29 @@ describe('example to-do app', () => { // This input has a data-test attribute so we'll use that to select the // element in accordance with best practices: // https://on.cypress.io/selecting-elements - cy.get('[data-test=new-todo]').type(`${newItem}{enter}`) + cy.get("[data-test=new-todo]").type(`${newItem}{enter}`) // Now that we've typed our new item, let's check that it actually was added to the list. // Since it's the newest item, it should exist as the last element in the list. // In addition, with the two default items, we should have a total of 3 elements in the list. // Since assertions yield the element that was asserted on, // we can chain both of these assertions together into a single statement. - cy.get('.todo-list li') - .should('have.length', 3) + cy.get(".todo-list li") + .should("have.length", 3) .last() - .should('have.text', newItem) + .should("have.text", newItem) }) - it('can check off an item as completed', () => { + it("can check off an item as completed", () => { // In addition to using the `get` command to get an element by selector, // we can also use the `contains` command to get an element by its contents. // However, this will yield the