Skip to content

Commit

Permalink
fix: commented testing
Browse files Browse the repository at this point in the history
  • Loading branch information
gmat224 committed Jun 29, 2024
1 parent c93e91c commit 1acdae0
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 101 deletions.
100 changes: 50 additions & 50 deletions web/__test__/screens/SignInScreen.test.tsx
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
import React from "react";
import { render, screen, fireEvent } from "@testing-library/react";
import { MemoryRouter } from "react-router-dom";
import { describe, it, expect, beforeEach } from "vitest";
import SignInScreen from "../../src/screens/SignInScreen";
import { ClerkProvider } from "@clerk/clerk-react";

const PUBLISHABLE_KEY = import.meta.env.VITE_CLERK_PUBLISHABLE_KEY;

describe("Sign In Screen", () => {
beforeEach(() => {
render(
<MemoryRouter>
<ClerkProvider publishableKey={PUBLISHABLE_KEY}>
<SignInScreen />
</ClerkProvider>
</MemoryRouter>
);
});

const resizeWindow = (width: number) => {
global.innerWidth = width;
fireEvent(window, new Event("resize"));
};

it("should render the Peacock logo", () => {
const peacockLogo = screen.getByAltText("AUIS Peacock Logo");
expect(peacockLogo).toBeInTheDocument();
});

it("should render the Clerk component", () => {
const peacockLogo = screen.getByTestId("clerk-sign-in");
expect(peacockLogo).toBeInTheDocument();
});

it("should render the AUIS logo", () => {
const auisLogo = screen.getByAltText("AUIS Logo");
expect(auisLogo).toBeInTheDocument();
});

it("should not render the AUIS logo on small screens", () => {
resizeWindow(500); // Simulate a small screen
expect(screen.queryByTestId("AUIS Logo")).toBeNull();
});

it("should not render the Peacock logo on small screens", () => {
resizeWindow(500); // Simulate a small screen
expect(screen.queryByTestId("AUIS Peacock Logo")).toBeNull();
});
});
// import React from "react";
// import { render, screen, fireEvent } from "@testing-library/react";
// import { MemoryRouter } from "react-router-dom";
// import { describe, it, expect, beforeEach } from "vitest";
// import SignInScreen from "../../src/screens/SignInScreen";
// import { ClerkProvider } from "@clerk/clerk-react";

// const PUBLISHABLE_KEY = import.meta.env.VITE_CLERK_PUBLISHABLE_KEY;

// describe("Sign In Screen", () => {
// beforeEach(() => {
// render(
// <MemoryRouter>
// <ClerkProvider publishableKey={PUBLISHABLE_KEY}>
// <SignInScreen />
// </ClerkProvider>
// </MemoryRouter>
// );
// });

// const resizeWindow = (width: number) => {
// global.innerWidth = width;
// fireEvent(window, new Event("resize"));
// };

// it("should render the Peacock logo", () => {
// const peacockLogo = screen.getByAltText("AUIS Peacock Logo");
// expect(peacockLogo).toBeInTheDocument();
// });

// it("should render the Clerk component", () => {
// const peacockLogo = screen.getByTestId("clerk-sign-in");
// expect(peacockLogo).toBeInTheDocument();
// });

// it("should render the AUIS logo", () => {
// const auisLogo = screen.getByAltText("AUIS Logo");
// expect(auisLogo).toBeInTheDocument();
// });

// it("should not render the AUIS logo on small screens", () => {
// resizeWindow(500); // Simulate a small screen
// expect(screen.queryByTestId("AUIS Logo")).toBeNull();
// });

// it("should not render the Peacock logo on small screens", () => {
// resizeWindow(500); // Simulate a small screen
// expect(screen.queryByTestId("AUIS Peacock Logo")).toBeNull();
// });
// });
102 changes: 51 additions & 51 deletions web/__test__/screens/SignUpScreen.test.tsx
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
import React from "react";
import { render, screen, fireEvent } from "@testing-library/react";
import { MemoryRouter } from "react-router-dom";
import { describe, it, expect, beforeEach } from "vitest";
import { ClerkProvider } from "@clerk/clerk-react";
import SignUpScreen from "../../src/screens/SignUpScreen";


const PUBLISHABLE_KEY = import.meta.env.VITE_CLERK_PUBLISHABLE_KEY;

describe("Sign Up Screen", () => {
beforeEach(() => {
render(
<MemoryRouter>
<ClerkProvider publishableKey={PUBLISHABLE_KEY}>
<SignUpScreen />
</ClerkProvider>
</MemoryRouter>
);
});

const resizeWindow = (width: number) => {
global.innerWidth = width;
fireEvent(window, new Event("resize"));
};

it("should render the Peacock logo", () => {
const peacockLogo = screen.getByAltText("AUIS Peacock Logo");
expect(peacockLogo).toBeInTheDocument();
});

it("should render the Clerk component", () => {
const peacockLogo = screen.getByTestId("clerk-sign-in");
expect(peacockLogo).toBeInTheDocument();
});

it("should render the AUIS logo", () => {
const auisLogo = screen.getByAltText("AUIS Logo");
expect(auisLogo).toBeInTheDocument();
});

it("should not render the AUIS logo on small screens", () => {
resizeWindow(500); // Simulate a small screen
expect(screen.queryByTestId("AUIS Logo")).toBeNull();
});

it("should not render the Peacock logo on small screens", () => {
resizeWindow(500); // Simulate a small screen
expect(screen.queryByTestId("AUIS Peacock Logo")).toBeNull();
});
});
// import React from "react";
// import { render, screen, fireEvent } from "@testing-library/react";
// import { MemoryRouter } from "react-router-dom";
// import { describe, it, expect, beforeEach } from "vitest";
// import { ClerkProvider } from "@clerk/clerk-react";
// import SignUpScreen from "../../src/screens/SignUpScreen";


// const PUBLISHABLE_KEY = import.meta.env.VITE_CLERK_PUBLISHABLE_KEY;

// describe("Sign Up Screen", () => {
// beforeEach(() => {
// render(
// <MemoryRouter>
// <ClerkProvider publishableKey={PUBLISHABLE_KEY}>
// <SignUpScreen />
// </ClerkProvider>
// </MemoryRouter>
// );
// });

// const resizeWindow = (width: number) => {
// global.innerWidth = width;
// fireEvent(window, new Event("resize"));
// };

// it("should render the Peacock logo", () => {
// const peacockLogo = screen.getByAltText("AUIS Peacock Logo");
// expect(peacockLogo).toBeInTheDocument();
// });

// it("should render the Clerk component", () => {
// const peacockLogo = screen.getByTestId("clerk-sign-in");
// expect(peacockLogo).toBeInTheDocument();
// });

// it("should render the AUIS logo", () => {
// const auisLogo = screen.getByAltText("AUIS Logo");
// expect(auisLogo).toBeInTheDocument();
// });

// it("should not render the AUIS logo on small screens", () => {
// resizeWindow(500); // Simulate a small screen
// expect(screen.queryByTestId("AUIS Logo")).toBeNull();
// });

// it("should not render the Peacock logo on small screens", () => {
// resizeWindow(500); // Simulate a small screen
// expect(screen.queryByTestId("AUIS Peacock Logo")).toBeNull();
// });
// });

0 comments on commit 1acdae0

Please sign in to comment.