Giter Site home page Giter Site logo

Comments (7)

JCQuintas avatar JCQuintas commented on August 16, 2024 1

Hi @benparks1976, the tests are green on my side with the example code you provided. I've noticed you are using node 14, which doesn't support the array.at() function. I would suggest upgrading your node to a more recent version, at is available from 16.6.

Otherwise you could also add a polyfill. eg: https://www.npmjs.com/package/array.prototype.at

from mui-x.

michelengelen avatar michelengelen commented on August 16, 2024

Hey @benparks1976 ... my colleague @JCQuintas noticed that you were using the old syntax.
If you change the code in your example to this it should work:

import React from "react";
import Demo from "../demo";
import { render } from "@testing-library/react";

describe("when rendering the data grid", () => {
    it("should render the table columns", async () => {
        const {findAllByRole} = render(<Demo/>)

        const headers = await findAllByRole("columnheader")!;

        expect(headers[1].textContent).toBe("Serial number");
        expect(headers[2].textContent).toBe("Model name");
    });
})

Could you try that please?

from mui-x.

benparks1976 avatar benparks1976 commented on August 16, 2024

Hi, thanks for the follow up. I tried your suggestion and I still got the same issue:

image

from mui-x.

michelengelen avatar michelengelen commented on August 16, 2024

It does work on my machine:
Screenshot 2024-06-05 at 11 33 09

Did you try a fresh install?

from mui-x.

benparks1976 avatar benparks1976 commented on August 16, 2024

Thanks @JCQuintas, this is the problem. Thanks all for your help.

from mui-x.

benparks1976 avatar benparks1976 commented on August 16, 2024

Closing...

from mui-x.

github-actions avatar github-actions commented on August 16, 2024

⚠️ This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

@benparks1976: How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.

from mui-x.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.