From 7e9eec4cc77c274548a44f97be0c7458272f1b89 Mon Sep 17 00:00:00 2001
From: JohnAllenTech <46611809+JohnAllenTech@users.noreply.github.com>
Date: Fri, 1 Nov 2024 10:25:26 -0600
Subject: [PATCH] chore: merged develop
---
.github/workflows/e2e-tests.yml | 6 -
E2E Overview.md | 13 +-
ISSUE_TEMPLATE.md | 16 +--
app/(app)/courses/[slug]/[id]/_client.tsx | 131 ++++++++++++++++++
app/(app)/courses/[slug]/[id]/page.tsx | 13 ++
app/(app)/courses/mock.ts | 130 +++++++++++++++++
.../editor/editor/components/bubble-menu.tsx | 50 +++----
.../editor/components/link-selector.tsx | 11 +-
.../editor/components/node-selector.tsx | 43 ++----
drizzle/seed.ts | 83 -----------
e2e/constants/constants.ts | 12 ++
e2e/constants/index.ts | 1 +
e2e/setup.ts | 120 +++++++++++++---
e2e/teardown.ts | 39 ++----
e2e/utils/utils.ts | 9 +-
sample.env | 6 -
utils/flags.ts | 1 +
17 files changed, 447 insertions(+), 237 deletions(-)
create mode 100644 app/(app)/courses/[slug]/[id]/_client.tsx
create mode 100644 app/(app)/courses/[slug]/[id]/page.tsx
create mode 100644 app/(app)/courses/mock.ts
create mode 100644 e2e/constants/constants.ts
create mode 100644 e2e/constants/index.ts
diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml
index b1922382..90250dc2 100644
--- a/.github/workflows/e2e-tests.yml
+++ b/.github/workflows/e2e-tests.yml
@@ -44,12 +44,6 @@ jobs:
GITHUB_ID: ${{ secrets.E2E_GITHUB_ID }}
GITHUB_SECRET: ${{ secrets.E2E_GITHUB_SECRET }}
NEXTAUTH_SECRET: ${{ secrets.NEXTAUTH_SECRET }}
- E2E_USER_ONE_EMAIL: e2e-user-one@codu.co
- E2E_USER_ONE_ID: 8e3179ce-f32b-4d0a-ba3b-234d66b836ad
- E2E_USER_ONE_SESSION_ID: df8a11f2-f20a-43d6-80a0-a213f1efedc1
- E2E_USER_TWO_EMAIL: e2e-user-two@codu.co
- E2E_USER_TWO_ID: a15a104a-0e34-4101-8800-ed25c9231345
- E2E_USER_TWO_SESSION_ID: 10134766-bc6c-4b52-83d7-46ec0a4cb95d
steps:
- name: Checkout repository
diff --git a/E2E Overview.md b/E2E Overview.md
index 54197f59..4493d66a 100644
--- a/E2E Overview.md
+++ b/E2E Overview.md
@@ -2,15 +2,6 @@
To run the end-to-end tests using Playwright, you need to configure your environment and follow these steps:
-### Environment Variables
-
-Ensure you have the following variables set in your `.env` file:
-
-- `E2E_USER_ID`: The ID of the E2E user for testing.
-- `E2E_USER_EMAIL`: The email of the E2E user for testing.
-- `E2E_USER_ONE_SESSION_ID`: The session ID that the user will use to authenticate.
-
-Note: The sample `.env` file is fine to use.
### Session and User Setup
@@ -38,11 +29,9 @@ For UI mode:
npx playwright test --ui
```
-### Additional E2E Environment Variables
+### Additional E2E constants
- **E2E_USER_ONE_SESSION_ID**: This is the session token UUID for one E2E user.
- **E2E_USER_TWO_SESSION_ID**: This is the session token UUID for another E2E user.
- **E2E_USER_ONE_ID**: The user ID of one of the E2E users.
- **E2E_USER_TWO_ID**: The user ID of another E2E user.
-
-These values are currently hardcoded and should be unique for each user.
diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md
index fad72169..096edb97 100644
--- a/ISSUE_TEMPLATE.md
+++ b/ISSUE_TEMPLATE.md
@@ -1,27 +1,27 @@
## Context
-Please provide any relevant information about your setup
+
## Expected Behavior
-Please describe the behavior you are expecting
+
## Current Behavior
-What is the current behavior?
+
## Screenshots
-Drag and drop screenshots here to better describe your issue
+
## Steps to reproduce
-Please provide detailed steps for reproducing the issue
-
+
## Additional info
-Provide any additional information here
+
diff --git a/app/(app)/courses/[slug]/[id]/_client.tsx b/app/(app)/courses/[slug]/[id]/_client.tsx
new file mode 100644
index 00000000..7359bc40
--- /dev/null
+++ b/app/(app)/courses/[slug]/[id]/_client.tsx
@@ -0,0 +1,131 @@
+"use client";
+import { FEATURE_FLAGS, isFlagEnabled } from "@/utils/flags";
+import { CircleCheck, SquarePlay } from "lucide-react";
+import { type Session } from "next-auth";
+import { notFound } from "next/navigation";
+import { mockContentList } from "../../mock";
+
+interface ContentProps {
+ session: Session | null;
+}
+
+const Content = ({ session }: ContentProps) => {
+ const flagEnabled = isFlagEnabled(FEATURE_FLAGS.COURSE_VIDEO);
+
+ if (!flagEnabled) {
+ notFound();
+ }
+
+ return (
+