You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importReactfrom"react";import{render}from"@testing-library/react";importFaqItemfrom"./FaqItem";describe("FaqItem",()=>{it("renders a FAQ item",()=>{constcomponent=render(<FaqItemquestion="What is the answer to life the universe and everything?"answer="42"/>);expect(component).toMatchSnapshot();});});
Corrected Code Snippet
importReactfrom"react";import{render}from"@testing-library/react";importFaqItemfrom"./FaqItem";describe("FaqItem",()=>{it("renders a FAQ item",()=>{constview=render(<FaqItemquestion="What is the answer to life the universe and everything?"answer="42"/>);expect(view).toMatchSnapshot();});});
The text was updated successfully, but these errors were encountered:
Issue
ESLint Error: eslint(testing-library/render-result-naming-convention) in the code snippet of the topic 7. Use Snapshot Testing
Link to Community Discussion. Assigning this issue to myself.
Incorrect Code Snippet
Corrected Code Snippet
The text was updated successfully, but these errors were encountered: