From 54c5e221a32670ba826969b4775ff2b7efd28b2a Mon Sep 17 00:00:00 2001 From: agilan11 <140779703+agilan11@users.noreply.github.com> Date: Wed, 5 Feb 2025 03:00:27 +0530 Subject: [PATCH] fix(curriculum): fixed test to allow both inline styles and CSS classes for text color (#58555) --- .../lab-real-time-counter/66bb3e20d3dc5b6d0a21f5dd.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/curriculum/challenges/english/25-front-end-development/lab-real-time-counter/66bb3e20d3dc5b6d0a21f5dd.md b/curriculum/challenges/english/25-front-end-development/lab-real-time-counter/66bb3e20d3dc5b6d0a21f5dd.md index e8d82c819e1..e365cd9a154 100644 --- a/curriculum/challenges/english/25-front-end-development/lab-real-time-counter/66bb3e20d3dc5b6d0a21f5dd.md +++ b/curriculum/challenges/english/25-front-end-development/lab-real-time-counter/66bb3e20d3dc5b6d0a21f5dd.md @@ -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.