Greenstand / treetracker-wallet-app

The Greenstand Wallet App
https://wallet.treetracker.org
14 stars 43 forks source link

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

Closed pierrelstan closed 1 month ago

pierrelstan commented 3 months ago

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