#8: Numbers do not display correctly within id=“display” : expected ‘0’ to equal ‘123’ .
The full text is:
- As I input numbers, I should be able to see my input in the element with the id of “display”
Numbers do not display correctly within id=“display” : expected ‘0’ to equal ‘123’ AssertionError: Numbers do not display correctly within id=“display” : expected ‘0’ to equal ‘123’
To which you ask:
Note: Why does the input ‘0’ lead to ‘123’?
It doesn’t. That’s the point.
It’s looking where it expects to find “123” and is finding “0” instead.
The user story says, “…see my input in the element with the id of ‘display’”. I interpret that to mean that it expects that in that element, not in a descendent element.
When I look at the test code, that confirms that:
it(`As I input numbers, I should be able to see my input in the element with the id of "display"`, function () {
clickButtonsById([_1, _2, _3]);
assert.strictEqual(
getInputValue(document.getElementById('display')),
'123',
'Numbers do not display correctly within id="display" '
);
});
The relevant code is here:
<div id="display" className={screenStyle} >
<input id="record"
className="bg-gray-700 p-2 text-2xl text-right text-yellow-200"
style={{fontFamily: 'ZCOOL QingKe HuangYou'}}
value={input}
placeholder="..."/>
<div id="result"
className="bg-gray-700 p-2 text-3xl text-right text-pink-400"
style={{fontFamily: 'Black Ops One'}}> { result }</div>
</div>
Do you see the issue?
I was able to get that test to pass by messing with the ids a little - but broke some other tests in the process so it might take a bit more.
I would also ask why that is an input
element - those should be for actually inputting code.
See if you can apply the same kind of detective logic to the other error.