Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

setTimeout for strictEqual function #446

Closed
MoatazAbdAlmageed opened this issue Jul 12, 2018 · 5 comments
Closed

setTimeout for strictEqual function #446

MoatazAbdAlmageed opened this issue Jul 12, 2018 · 5 comments

Comments

@MoatazAbdAlmageed
Copy link

MoatazAbdAlmageed commented Jul 12, 2018

I'm finalizing " Build a JavaScript Calculator" project using react
I notices when adding setTimeout to assert.strictEqual function some teste passed

assert.strictEqual = function (act, exp, msg) {
          window.setTimeout(function(){
              new Assertion(act, msg).to.equal(exp);

          }, 600);

	  };

Here is my repo | plnkr

Edit : Here is used test file with set time out
File

@MoatazAbdAlmageed
Copy link
Author

@tbushman I'm using setState function I think it takes a time to update the view if you checked the plnkr all testes passed after make timeout

@MoatazAbdAlmageed
Copy link
Author

MoatazAbdAlmageed commented Jul 14, 2018

@tbushman I was using text input element as #display so I changed it to so I can log the value of document.getElementById('display').innerHTML I will check and tell you the result .

I think we have to change User Story #6: My calculator should contain an element (like <h1 id="display">{this.state.display}</h1> ) to display values with a corresponding id="display". to avoid using elemnts like input as I did :(

also change
https://gitcdn.link/repo/freeCodeCamp/testable-projects-fcc/master/build/bundle.js
to be https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js because first URL not working !!

@MoatazAbdAlmageed
Copy link
Author

MoatazAbdAlmageed commented Jul 15, 2018

@tbushman Now all testes works well without any TimeOut please check plnkr

I'm sorry but is my issue because I used input as display element

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@MoatazAbdAlmageed and others