Skip to content

Commit 54c5e22

Browse files
authored
fix(curriculum): fixed test to allow both inline styles and CSS classes for text color (freeCodeCamp#58555)
1 parent c14f021 commit 54c5e22

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

curriculum/challenges/english/25-front-end-development/lab-real-time-counter/66bb3e20d3dc5b6d0a21f5dd.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,16 @@ const charCount = document.getElementById('char-count');
6565
textInput.value = "I am learning a new language and it is called c++.";
6666
textInput.dispatchEvent(new Event('input'));
6767
textInput.dispatchEvent(new Event('change'));
68-
assert.strictEqual(charCount.style.color, 'red');
68+
const computedStyle = window.getComputedStyle(charCount);
69+
assert.oneOf(computedStyle.color, [
70+
"red",
71+
"rgb(255, 0, 0)",
72+
"rgb(100%, 0%, 0%)",
73+
"rgba(255, 0, 0, 1)",
74+
"rgba(100%, 0%, 0%, 1)",
75+
"hsl(0, 100%, 50%)",
76+
"hsla(0, 100%, 50%, 1)"
77+
]);
6978
```
7079
7180
If character count is greater than or equal to `50`, the user shouldn't be able to enter more characters.

0 commit comments

Comments
 (0)