fix(curriculum): fixed test to allow both inline styles and CSS classes for text color (#58555)

This commit is contained in:
agilan11
2025-02-05 03:00:27 +05:30
committed by GitHub
parent c14f0216cd
commit 54c5e221a3
@@ -65,7 +65,16 @@ const charCount = document.getElementById('char-count');
textInput.value = "I am learning a new language and it is called c++.";
textInput.dispatchEvent(new Event('input'));
textInput.dispatchEvent(new Event('change'));
assert.strictEqual(charCount.style.color, 'red');
const computedStyle = window.getComputedStyle(charCount);
assert.oneOf(computedStyle.color, [
"red",
"rgb(255, 0, 0)",
"rgb(100%, 0%, 0%)",
"rgba(255, 0, 0, 1)",
"rgba(100%, 0%, 0%, 1)",
"hsl(0, 100%, 50%)",
"hsla(0, 100%, 50%, 1)"
]);
```
If character count is greater than or equal to `50`, the user shouldn't be able to enter more characters.