Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Component Test Fails with Cypress, Passes with HTML Tag #229

Closed
pierrelstan opened this issue Aug 9, 2024 · 0 comments · Fixed by #238
Closed

Bug: Component Test Fails with Cypress, Passes with HTML Tag #229

pierrelstan opened this issue Aug 9, 2024 · 0 comments · Fixed by #238
Assignees
Labels
bug Something isn't working high-priority urgent problem next.js

Comments

@pierrelstan
Copy link
Collaborator

pierrelstan commented Aug 9, 2024

Describe the Bug

In the web app (apps/web), the test fails when running the component test using Cypress. However, when using the HTML tag in the component that we test against, the test passes.

To Reproduce

Step 1: Create a Component

Create a new component with any name you wish.

Step 2: Add a Basic Material UI Component

Add a basic component from Material UI to the component you created in Step 1. For example, you can add a Button component:

import React from 'react';
import Button from '@mui/material/Button';

const MyComponent = () => {
  return (
    <div>
      <Button variant="contained" color="primary">
        Click me
      </Button>
    </div>
  );
};

Step 3: Create a Test Component

Create a test component to test the component you created in Step 2.

Step 4: Run the Test

Open the terminal and run the following command:

start-server-and-test dev http://localhost:3000 "cypress run --e2e"

screenshots
Screenshot from 2024-08-08 22-18-03

@pierrelstan pierrelstan added bug Something isn't working challenge tricky/hard/hack-style problem high-priority urgent problem next.js and removed challenge tricky/hard/hack-style problem labels Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working high-priority urgent problem next.js
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants