Files
Balázs OrbánandGitHub f052fa8d6c chore(examples): fix with-cypress build (#62614)
### What?

Fix the `with-cypress` example build errors.

### Why?

`next build` is broken.

### How?

exclude tests from compilation, fix import

Fixes #50124

Closes NEXT-2629
2024-02-27 23:54:52 +01:00

24 lines
879 B
TypeScript

import AboutComponent from "./about-component";
/* eslint-disable */
// Disable ESLint to prevent failing linting inside the Next.js repo.
// If you're using ESLint on your project, we recommend installing the ESLint Cypress plugin instead:
// https://github.com/cypress-io/eslint-plugin-cypress
// Cypress Component Test
describe("<AboutComponent />", () => {
it("should render and display expected content in a Client Component", () => {
// Mount the React component for the About page
cy.mount(<AboutComponent />);
// The new page should contain an h1 with "About page"
cy.get("h1").contains("About Page");
// Validate that a link with the expected URL is present
// *Following* the link is better suited to an E2E test
cy.get('a[href="/"]').should("be.visible");
});
});
// Prevent TypeScript from reading file as legacy script
export {};