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;
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
add a comment |
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
add a comment |
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
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
reactjs react-testing-library codesandbox
asked Mar 27 at 21:59
Piotr KaluzaPiotr Kaluza
3931 silver badge7 bronze badges
3931 silver badge7 bronze badges
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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.
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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
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
add a comment |
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.
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
add a comment |
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.
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.
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
add a comment |
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
add a comment |
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.
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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