From a3e9d72799fbf778cb88461a44e3f78581de80e5 Mon Sep 17 00:00:00 2001 From: ParadigmMango2 Date: Sun, 7 Apr 2024 15:37:59 -0600 Subject: [PATCH 1/7] Added basic function for the TestLogin feature --- packages/app/cypress/e2e/tests/TestLogin.cy.js | 10 ++++++++++ packages/app/src/config/site.ts | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/packages/app/cypress/e2e/tests/TestLogin.cy.js b/packages/app/cypress/e2e/tests/TestLogin.cy.js index e69de29b..b0e8aa6f 100644 --- a/packages/app/cypress/e2e/tests/TestLogin.cy.js +++ b/packages/app/cypress/e2e/tests/TestLogin.cy.js @@ -0,0 +1,10 @@ +import { siteConfig } from "../../../src/config/site"; + +beforeEach(() => { + cy.visit("/"); +}); + +it("can rach the login page and access github API", () => { + +}); + diff --git a/packages/app/src/config/site.ts b/packages/app/src/config/site.ts index dd87d673..ebeb5a37 100644 --- a/packages/app/src/config/site.ts +++ b/packages/app/src/config/site.ts @@ -37,6 +37,11 @@ export const siteConfig = { href: "/contributors", }); + items.push({ + title: "Login", + href: "/api/auth/signin", + }); + return items; }, From f4380565d7756544cba8bcb49eae3f4e65d6019e Mon Sep 17 00:00:00 2001 From: ParadigmMango2 Date: Sun, 7 Apr 2024 16:15:54 -0600 Subject: [PATCH 2/7] Implemented a basic login test --- packages/app/cypress/e2e/tests/TestLogin.cy.js | 10 ++++++++-- packages/app/src/components/ui/buttons.tsx | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/app/cypress/e2e/tests/TestLogin.cy.js b/packages/app/cypress/e2e/tests/TestLogin.cy.js index b0e8aa6f..f5794314 100644 --- a/packages/app/cypress/e2e/tests/TestLogin.cy.js +++ b/packages/app/cypress/e2e/tests/TestLogin.cy.js @@ -4,7 +4,13 @@ beforeEach(() => { cy.visit("/"); }); -it("can rach the login page and access github API", () => { - +it("can reach the login page and access github API", () => { + // cy.contains('button', 'Sign in').click() + cy.get('[data-cy="sign in"]').click() + + // cy.url().should('include', 'github.com/login') + cy.on("url:changed", (newUrl) => { + expect(newUrl).to.contain("github.com/login") + }) }); diff --git a/packages/app/src/components/ui/buttons.tsx b/packages/app/src/components/ui/buttons.tsx index acb0d6b1..e347a15d 100644 --- a/packages/app/src/components/ui/buttons.tsx +++ b/packages/app/src/components/ui/buttons.tsx @@ -10,6 +10,7 @@ export const LoginButton = () => {