From ae805e5d80ec322580bf43b1d880ec5fb301caae Mon Sep 17 00:00:00 2001
From: Owen Rees
Date: Thu, 22 Jun 2023 09:45:07 +0200
Subject: [PATCH 1/3] map length corrected
---
TODO | 4 +---
app/layout.tsx | 3 ++-
components/TournamentMap.tsx | 2 +-
components/TournamentTable.tsx | 2 +-
4 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/TODO b/TODO
index 6724f3e..8c1f8dc 100644
--- a/TODO
+++ b/TODO
@@ -10,7 +10,7 @@ TESTS
BUGS
//TODO about page is not centred in Safari
//TODO tournament page load is weird on 2nd click. On safari it pauses for a few seconds. Is it trying to load the entire page before displaying?
-//TODO Nodemailer 'from' reverts to echecsfrance@gmail.com
+//TODO Nodemailer 'from' reverts to echecsfrance@gmail.com - quick fix done with sender address in subject line
----------------------------------------------------------------
PAGES
@@ -20,9 +20,7 @@ PAGES
DESIGN CHANGES
//TODO test entire site for english to french translations
//TODO success and error messages into french - mailer
-//TODO disable send message button while sending - isSending = true
//TODO font size on mobile screen
-//TODO bottom of map is a few pixels short
//TODO mobile navbar is creeping into the page by a few pixels when hidden - move it to the right a bit. It is easier to see in light mode
//TODO logo for navbar and favicon
//TODO mobile map needs improving
diff --git a/app/layout.tsx b/app/layout.tsx
index f09c65b..50bb68a 100644
--- a/app/layout.tsx
+++ b/app/layout.tsx
@@ -7,7 +7,8 @@ const inter = Inter({ subsets: ["latin"] });
export const metadata = {
title: "Echecs France",
- description: "Generated by create next app", // TODO give the website a description + maybe keywords if they go here
+ description: "Trouvez Vos Tournois d'Echecs en France Sur Une Carte",
+ keywords: "echecs, France, tournoi, tournois, FFE",
};
export default function RootLayout({
diff --git a/components/TournamentMap.tsx b/components/TournamentMap.tsx
index 0323030..c060eb3 100644
--- a/components/TournamentMap.tsx
+++ b/components/TournamentMap.tsx
@@ -24,7 +24,7 @@ export default function TournamentMap({ tournamentData }: TournamentDataProps) {
return (
From 6f7b840b54ae741f176e08bcbe195ebedadf723a Mon Sep 17 00:00:00 2001
From: Owen Rees
Date: Thu, 22 Jun 2023 12:52:41 +0200
Subject: [PATCH 2/3] contact form tests
---
TODO | 8 +--
app/api/v1/tournaments/france/route.ts | 1 -
app/tournois/page.tsx | 2 -
components/ContactForm.tsx | 6 ++
cypress/component/utils.cy.ts | 55 -------------------
cypress/e2e/contactForm.cy.ts | 50 +++++++++++++++++
cypress/e2e/{data.cy.tsx => data.cy.ts} | 0
cypress/e2e/links.cy.ts | 61 ++++++++++++++++-----
cypress/e2e/{navbar.cy.tsx => navbar.cy.ts} | 0
cypress/e2e/{scroll.cy.tsx => scroll.cy.ts} | 0
cypress/support/commands.ts | 12 +++-
11 files changed, 116 insertions(+), 79 deletions(-)
delete mode 100644 cypress/component/utils.cy.ts
create mode 100644 cypress/e2e/contactForm.cy.ts
rename cypress/e2e/{data.cy.tsx => data.cy.ts} (100%)
rename cypress/e2e/{navbar.cy.tsx => navbar.cy.ts} (100%)
rename cypress/e2e/{scroll.cy.tsx => scroll.cy.ts} (100%)
diff --git a/TODO b/TODO
index 8c1f8dc..56f6f90 100644
--- a/TODO
+++ b/TODO
@@ -1,10 +1,6 @@
TESTS
// TODO tests for tournament page:
- map and table mounts in tournament page <- get data to send to map/table
-//TODO data fetching tests
-//TODO redo layer groups tests
-//TODO write tests for contact form
-//TODO dead link tests take too long, split them into separate tests per page
-----------------------------------------------------------------
BUGS
@@ -21,20 +17,18 @@ DESIGN CHANGES
//TODO test entire site for english to french translations
//TODO success and error messages into french - mailer
//TODO font size on mobile screen
-//TODO mobile navbar is creeping into the page by a few pixels when hidden - move it to the right a bit. It is easier to see in light mode
+//TODO mobile navbar is creeping into the page by a few pixels when hidden - move it to the right a bit. It is easier to see in light mode. I cant see this on Linux
//TODO logo for navbar and favicon
//TODO mobile map needs improving
----------------------------------------------------------------
LOGIC
-//TODO SRP for web and API data fetching
//TODO error handling
//TODO consider offering GraphQL support
MISC
----------------------------------------------------------------
//TODO write logger (fullstack open examples)
-//TODO SEO - next headers etc
//TODO multi-language i18n support - https://nextjs.org/docs/app/building-your-application/routing/internationalization
//TODO move smaller ui components into a new folder, and make them reusable - such as using generic prop names
//TODO readme
diff --git a/app/api/v1/tournaments/france/route.ts b/app/api/v1/tournaments/france/route.ts
index afcd444..0ccd2c1 100644
--- a/app/api/v1/tournaments/france/route.ts
+++ b/app/api/v1/tournaments/france/route.ts
@@ -14,7 +14,6 @@ export async function GET() {
try {
const client = await clientPromise;
const db = client.db("tournamentsFranceDB");
-
const results = await dateOrderingFrance(db);
const data = results.map(({ _id, ...rest }) => ({
id: _id,
diff --git a/app/tournois/page.tsx b/app/tournois/page.tsx
index 03c69d1..c6cc6e9 100644
--- a/app/tournois/page.tsx
+++ b/app/tournois/page.tsx
@@ -23,9 +23,7 @@ const getTournaments = async () => {
try {
const client = await clientPromise;
const db = client.db("tournamentsFranceDB");
-
const data = await dateOrderingFrance(db);
-
return JSON.stringify(data);
} catch (error) {
throw new Error("Error fetching tournament data");
diff --git a/components/ContactForm.tsx b/components/ContactForm.tsx
index d80148a..5902691 100644
--- a/components/ContactForm.tsx
+++ b/components/ContactForm.tsx
@@ -17,6 +17,7 @@ const ContactForm = () => {
className={`${
responseMessage.isSuccessful ? "text-green-600" : "text-red-600"
} italic`}
+ data-cy="info-message"
>
{responseMessage.message}