I Don't know if it is a general issue or only related to this task.
if i write folling code in the exercise:
$("#getMessage").on("click", function() {
//alert((".message"));
(".message").html("You clicked get Message");
});
This test will pass, even though i should have put a dollar sign before ("message"). I found this error when I passed the test, but the message didn't change on the mobile screen.
link
// If relevant, paste all of your challenge code in here
It seems that the tests for this challenge only test that you attached a handler to the button's click event. It doesn't check what the handler is actually doing something or that it is valid.
This challenge needs an additional test case to check the below is doing what it should be
$(".message").html("You clicked get Message");
Yes. Tests for this challenge only check for attachment of event handler.
What i found more interesting was that instructions for this challenge encompasses instructions for next challenge also as both of these ask the camper to update the html of the div with the class ".message" in addition to to first challenge asking for attaching an event handler.
Taking a guess, I don't _think_ the first challenge is supposed to have instructions for updating html.
so maybe, the two tasks should be merged together or update the instruction.
Conceptually both tasks are different and independent. That's why i believe they had been broken into two steps. Lets see what core team has to say about it
Oh Yes, this is an utter confusion. Sorry my bad.
@raynor84 @nishant-tomer thanks.
The tests are actually correct. the instructions confused me as well.
The code from the issue description is not required at all. The below block is unnecessary.
//alert((".message"));
(".message").html("You clicked get Message");
That's the reason the tests do not look for it.
The below should rather be updated
Let's make our "Get Message" button change the text of the element with the class message.
Before we can do this, we need to implement a click event inside of our $(document).ready() function by adding this code:
to perhaps:
Let's implement a click event inside of our $(document).ready() function by adding this code:
code blockProceed to the next challenge where we will make our "Get Message" button change the text of the element with the class message.
/cc @erictleung
@nishant-tomer you are correct we still need two challenges, for the sake of not overwhelming target audience.
do i go ahead and update the instructions and have someone review them or we need to decide the exact final instructions before editing?
You can make the PR and we can update you in the comments if we need a change, this should be pretty straight.
I would rather wait for @erictleung though for second thoughts.
@nishant-tomer Yeah, the JSON and Ajax challenges need some love. But I like @raisedadead's suggestion on the instruction changes.
Let's implement a
click eventinside of our$(document).ready()function by adding this code:code blockThen proceed to the next challenge where we will make our "Get Message" button change the text of the element with the class message.
Most helpful comment
Oh Yes, this is an utter confusion. Sorry my bad.
@raynor84 @nishant-tomer thanks.
The tests are actually correct. the instructions confused me as well.
The code from the issue description is not required at all. The below block is unnecessary.
That's the reason the tests do not look for it.
The below should rather be updated
to perhaps: