Issue with React-Testing-Library in codesandbox.ioreact-testing-library cleanup doesn't work in codesandboxUpdating React component state in Jasmine TestLoop inside React JSXReact vs Angular: Slow rendering with ReactProgrammatically navigate using react routerUsing React in a multi-page appReact with Redux? What about the 'context' issue?React functional stateless component, PureComponent, Component; what are the differences and when should we use what?Basic React Tests Failing after Implementing Reduxreact-testing-library and codesandbox problem when writing tests for component and parentWrite test to check local setState call with jest and testing-react-library

Moscow SVO airport, how to avoid scam taxis without pre-booking?

Why did the population of Bhutan drop by 70% between 2007 and 2008?

How can I reply to coworkers who accuse me of automating people out of work?

Spicing up a moment of peace

What is a "hard problem" in the context of Mixed-integer programming?

Group riding etiquette

In what language did Túrin converse with Mím?

Where does the last newline character come from in this sed's result?

Why did Lucius make a deal out of Buckbeak hurting Draco but not about Draco being turned into a ferret?

Why doesn't Starship have four landing legs?

Why does Sauron not permit his followers to use his name?

Coupling two 15 Amp circuit breaker for 20 Amp

Generic method to call API functions with simple retrial on errors

Printing a list as "a, b, c." using Python

Can a network vulnerability be exploited locally?

Get contents before a colon

Why does `buck` mean `step-down`?

Do multi-engine jets need all engines with equal age to reduce asymmetry in thrust and fuel consumption arising out of deterioration?

What is this "opened" cube called?

What checks exist against overuse of presidential pardons in the USA?

Inspiration for failed idea?

How can I throw a body?

What is Soda Fountain Etiquette?

Board Chinese train at a different station (on-route)



Issue with React-Testing-Library in codesandbox.io


react-testing-library cleanup doesn't work in codesandboxUpdating React component state in Jasmine TestLoop inside React JSXReact vs Angular: Slow rendering with ReactProgrammatically navigate using react routerUsing React in a multi-page appReact with Redux? What about the 'context' issue?React functional stateless component, PureComponent, Component; what are the differences and when should we use what?Basic React Tests Failing after Implementing Reduxreact-testing-library and codesandbox problem when writing tests for component and parentWrite test to check local setState call with jest and testing-react-library






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








2















I am a relative noob to React. Wanted to practice some tdd in this sandbox basic react sandbox. It seems that the test code is affecting app component state
If you switch between Browser and Tests you'll see test items being added to the list - even though i am running render and cleanup in the tests.



Not sure what I am doing wrong?










share|improve this question






























    2















    I am a relative noob to React. Wanted to practice some tdd in this sandbox basic react sandbox. It seems that the test code is affecting app component state
    If you switch between Browser and Tests you'll see test items being added to the list - even though i am running render and cleanup in the tests.



    Not sure what I am doing wrong?










    share|improve this question


























      2












      2








      2








      I am a relative noob to React. Wanted to practice some tdd in this sandbox basic react sandbox. It seems that the test code is affecting app component state
      If you switch between Browser and Tests you'll see test items being added to the list - even though i am running render and cleanup in the tests.



      Not sure what I am doing wrong?










      share|improve this question














      I am a relative noob to React. Wanted to practice some tdd in this sandbox basic react sandbox. It seems that the test code is affecting app component state
      If you switch between Browser and Tests you'll see test items being added to the list - even though i am running render and cleanup in the tests.



      Not sure what I am doing wrong?







      reactjs react-testing-library codesandbox






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 27 at 21:59









      Piotr KaluzaPiotr Kaluza

      3931 silver badge7 bronze badges




      3931 silver badge7 bronze badges

























          1 Answer
          1






          active

          oldest

          votes


















          0















          Codesandbox has some problems running the tests. That's because they run in the browser and not in a separate jsdom environment. I suggest you run the tests in your machine instead.






          share|improve this answer

























          • Thank you, BTW CodeSandbox works fine when using Enzyme here's another sandbox codesandbox.io/s/6nwj46qwn3

            – Piotr Kaluza
            Mar 28 at 17:29












          • I think it's because Enzyme mocks the rendered components while RTL tries to make a real render

            – Giorgio Polvara - Gpx
            Mar 28 at 19:22






          • 1





            Right, shallow vs render - another thing could be the RTL getByTestId which I have been using since the data-testId attribute exists in the app output it matches the real one first. Funny thing is the creator of RTL had a youtube video where he experienced the same issue youtube.com/watch?v=kCR3JAR7CHE

            – Piotr Kaluza
            Mar 28 at 19:32










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55387122%2fissue-with-react-testing-library-in-codesandbox-io%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0















          Codesandbox has some problems running the tests. That's because they run in the browser and not in a separate jsdom environment. I suggest you run the tests in your machine instead.






          share|improve this answer

























          • Thank you, BTW CodeSandbox works fine when using Enzyme here's another sandbox codesandbox.io/s/6nwj46qwn3

            – Piotr Kaluza
            Mar 28 at 17:29












          • I think it's because Enzyme mocks the rendered components while RTL tries to make a real render

            – Giorgio Polvara - Gpx
            Mar 28 at 19:22






          • 1





            Right, shallow vs render - another thing could be the RTL getByTestId which I have been using since the data-testId attribute exists in the app output it matches the real one first. Funny thing is the creator of RTL had a youtube video where he experienced the same issue youtube.com/watch?v=kCR3JAR7CHE

            – Piotr Kaluza
            Mar 28 at 19:32















          0















          Codesandbox has some problems running the tests. That's because they run in the browser and not in a separate jsdom environment. I suggest you run the tests in your machine instead.






          share|improve this answer

























          • Thank you, BTW CodeSandbox works fine when using Enzyme here's another sandbox codesandbox.io/s/6nwj46qwn3

            – Piotr Kaluza
            Mar 28 at 17:29












          • I think it's because Enzyme mocks the rendered components while RTL tries to make a real render

            – Giorgio Polvara - Gpx
            Mar 28 at 19:22






          • 1





            Right, shallow vs render - another thing could be the RTL getByTestId which I have been using since the data-testId attribute exists in the app output it matches the real one first. Funny thing is the creator of RTL had a youtube video where he experienced the same issue youtube.com/watch?v=kCR3JAR7CHE

            – Piotr Kaluza
            Mar 28 at 19:32













          0














          0










          0









          Codesandbox has some problems running the tests. That's because they run in the browser and not in a separate jsdom environment. I suggest you run the tests in your machine instead.






          share|improve this answer













          Codesandbox has some problems running the tests. That's because they run in the browser and not in a separate jsdom environment. I suggest you run the tests in your machine instead.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 28 at 14:44









          Giorgio Polvara - GpxGiorgio Polvara - Gpx

          3,5322 gold badges20 silver badges36 bronze badges




          3,5322 gold badges20 silver badges36 bronze badges















          • Thank you, BTW CodeSandbox works fine when using Enzyme here's another sandbox codesandbox.io/s/6nwj46qwn3

            – Piotr Kaluza
            Mar 28 at 17:29












          • I think it's because Enzyme mocks the rendered components while RTL tries to make a real render

            – Giorgio Polvara - Gpx
            Mar 28 at 19:22






          • 1





            Right, shallow vs render - another thing could be the RTL getByTestId which I have been using since the data-testId attribute exists in the app output it matches the real one first. Funny thing is the creator of RTL had a youtube video where he experienced the same issue youtube.com/watch?v=kCR3JAR7CHE

            – Piotr Kaluza
            Mar 28 at 19:32

















          • Thank you, BTW CodeSandbox works fine when using Enzyme here's another sandbox codesandbox.io/s/6nwj46qwn3

            – Piotr Kaluza
            Mar 28 at 17:29












          • I think it's because Enzyme mocks the rendered components while RTL tries to make a real render

            – Giorgio Polvara - Gpx
            Mar 28 at 19:22






          • 1





            Right, shallow vs render - another thing could be the RTL getByTestId which I have been using since the data-testId attribute exists in the app output it matches the real one first. Funny thing is the creator of RTL had a youtube video where he experienced the same issue youtube.com/watch?v=kCR3JAR7CHE

            – Piotr Kaluza
            Mar 28 at 19:32
















          Thank you, BTW CodeSandbox works fine when using Enzyme here's another sandbox codesandbox.io/s/6nwj46qwn3

          – Piotr Kaluza
          Mar 28 at 17:29






          Thank you, BTW CodeSandbox works fine when using Enzyme here's another sandbox codesandbox.io/s/6nwj46qwn3

          – Piotr Kaluza
          Mar 28 at 17:29














          I think it's because Enzyme mocks the rendered components while RTL tries to make a real render

          – Giorgio Polvara - Gpx
          Mar 28 at 19:22





          I think it's because Enzyme mocks the rendered components while RTL tries to make a real render

          – Giorgio Polvara - Gpx
          Mar 28 at 19:22




          1




          1





          Right, shallow vs render - another thing could be the RTL getByTestId which I have been using since the data-testId attribute exists in the app output it matches the real one first. Funny thing is the creator of RTL had a youtube video where he experienced the same issue youtube.com/watch?v=kCR3JAR7CHE

          – Piotr Kaluza
          Mar 28 at 19:32





          Right, shallow vs render - another thing could be the RTL getByTestId which I have been using since the data-testId attribute exists in the app output it matches the real one first. Funny thing is the creator of RTL had a youtube video where he experienced the same issue youtube.com/watch?v=kCR3JAR7CHE

          – Piotr Kaluza
          Mar 28 at 19:32








          Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







          Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55387122%2fissue-with-react-testing-library-in-codesandbox-io%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

          용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

          155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해