Skip to content

Commit

Permalink
Fix lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
codeincontext committed Sep 25, 2024
1 parent 7c774d0 commit 8cdb0c3
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 10 deletions.
4 changes: 2 additions & 2 deletions apps/nextjs/src/app/api/trpc/test-support/[trpc]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import { NextRequest, NextResponse } from "next/server";

import { withSentry } from "@/lib/sentry/withSentry";

export const testSupportEnabled =
const testSupportEnabled =
process.env.NODE_ENV === "development" ||
process.env.VERCEL_ENV === "preview";

export const testSupportRouter = testSupportEnabled
const testSupportRouter = testSupportEnabled
? testSupportRouterInternal
: router({});

Expand Down
2 changes: 1 addition & 1 deletion apps/nextjs/tests-e2e/config/ui-auth.setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { clerkSetup, setupClerkTestingToken } from "@clerk/testing/playwright";
import { Page, expect, test as setup } from "@playwright/test";
import path from "path";

import { bypassVercelProtection } from "../helpers";
import { bypassVercelProtection } from "../helpers/vercel";
import { TEST_USER_EMAIL, TEST_USER_PASSWORD, TEST_BASE_URL } from "./config";

const authFile = path.join(__dirname, "../.auth/user.json");
Expand Down
2 changes: 1 addition & 1 deletion apps/nextjs/tests-e2e/helpers/vercel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Page } from "@playwright/test";
import {
TEST_BASE_URL,
VERCEL_AUTOMATION_BYPASS_SECRET,
} from "./config/config";
} from "../config/config";

export async function bypassVercelProtection(page: Page) {
if (!VERCEL_AUTOMATION_BYPASS_SECRET) {
Expand Down
2 changes: 1 addition & 1 deletion apps/nextjs/tests-e2e/tests/aila-chat/auth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { clerkSetup, setupClerkTestingToken } from "@clerk/testing/playwright";
import { test, expect } from "@playwright/test";

import { TEST_BASE_URL } from "../../config/config";
import { bypassVercelProtection } from "../../helpers";
import { bypassVercelProtection } from "../../helpers/vercel";

test.describe("Unauthenticated", () => {
test("redirects to /sign-in", async ({ page }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { clerkSetup, setupClerkTestingToken } from "@clerk/testing/playwright";
import { test, expect } from "@playwright/test";

import { TEST_BASE_URL } from "../../config/config";
import { bypassVercelProtection } from "../../helpers";
import { bypassVercelProtection } from "../../helpers/vercel";
import { continueChat, isFinished, waitForGeneration } from "./helpers";

const generationTimeout = 75000;
Expand Down
2 changes: 1 addition & 1 deletion apps/nextjs/tests-e2e/tests/aila-chat/full-romans.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { clerkSetup, setupClerkTestingToken } from "@clerk/testing/playwright";
import { test, expect, Page } from "@playwright/test";

import { TEST_BASE_URL } from "../../config/config";
import { bypassVercelProtection } from "../../helpers";
import { bypassVercelProtection } from "../../helpers/vercel";
import {
continueChat,
expectSectionsComplete,
Expand Down
6 changes: 6 additions & 0 deletions apps/nextjs/tests-e2e/tests/demo-accounts.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import { clerkSetup, setupClerkTestingToken } from "@clerk/testing/playwright";

Check failure on line 1 in apps/nextjs/tests-e2e/tests/demo-accounts.test.ts

View workflow job for this annotation

GitHub Actions / test-e2e

[public] › tests/demo-accounts.test.ts:9:7 › Demo accounts › should see the demo banner

1) [public] › tests/demo-accounts.test.ts:9:7 › Demo accounts › should see the demo banner › Prepare user › tRPC.prepareUser TRPCClientError: fetch failed at Function.from (/home/runner/work/oak-ai-lesson-assistant/oak-ai-lesson-assistant/node_modules/@trpc/client/dist/TRPCClientError-7e0c***1e7.js:40:16) at /home/runner/work/oak-ai-lesson-assistant/oak-ai-lesson-assistant/node_modules/@trpc/client/dist/httpUtils-4429f***6e.js:1***0:52
import { test, expect } from "@playwright/test";

import { TEST_BASE_URL } from "../config/config";
import { prepareUser } from "../helpers/auth";
import { bypassVercelProtection } from "../helpers/vercel";

test.describe("Demo accounts", () => {
test("should see the demo banner", async ({ page }) => {
await bypassVercelProtection(page);
await clerkSetup();
await setupClerkTestingToken({ page });

await prepareUser(page, "demo");

await page.goto(`${TEST_BASE_URL}/aila`);
Expand Down
2 changes: 1 addition & 1 deletion apps/nextjs/tests-e2e/tests/public.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { test, expect } from "@playwright/test";

import { TEST_BASE_URL } from "../config/config";
import { bypassVercelProtection } from "../helpers";
import { bypassVercelProtection } from "../helpers/vercel";

test("/ loads", async ({ page }) => {
await bypassVercelProtection(page);
Expand Down
2 changes: 1 addition & 1 deletion apps/nextjs/tests-e2e/tests/quiz-designer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { clerkSetup } from "@clerk/testing/playwright";
import { test, expect } from "@playwright/test";

import { TEST_BASE_URL } from "../config/config";
import { bypassVercelProtection } from "../helpers";
import { bypassVercelProtection } from "../helpers/vercel";

test(
"navigate to /quiz-designer as a signed-in user",
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/router/testSupport/prepareUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const prepareUser = publicProcedure
variant: z.enum(["typical", "demo"]),
}),
)
.mutation(async ({ ctx, input }) => {
.mutation(async ({ input }) => {
const email = `test+${branch}-${input.variant}@thenational.academy`;

const user = await findOrCreateUser(email, input.variant);
Expand Down

0 comments on commit 8cdb0c3

Please sign in to comment.