From db0d0386fa25960c900b1d759fb4f9c64764cded Mon Sep 17 00:00:00 2001 From: Shunguo Yan Date: Thu, 11 May 2023 15:19:07 -0500 Subject: [PATCH] update test cases #1304 --- .../src/v4/rules/text_contrast_sufficient.ts | 2 +- .../act_pass_7.html | 25 +------------------ .../special-chars-1.html | 6 ++--- 3 files changed, 5 insertions(+), 28 deletions(-) diff --git a/accessibility-checker-engine/src/v4/rules/text_contrast_sufficient.ts b/accessibility-checker-engine/src/v4/rules/text_contrast_sufficient.ts index da4e47e96..559612cc3 100644 --- a/accessibility-checker-engine/src/v4/rules/text_contrast_sufficient.ts +++ b/accessibility-checker-engine/src/v4/rules/text_contrast_sufficient.ts @@ -106,7 +106,7 @@ export let text_contrast_sufficient: Rule = { */ let regex = /[^(a-zA-Z\d\s)\u0000-\u0008\u000B-\u001F\u007F-\u009F\u2000-\u200F\u2028-\u202F\u205F-\u206F\u3000\uFEFF]+/g; const removed = childStr.trim().replace(regex, ''); - if (removed.length === 0) + if (removed.trim().length === 0) return null; } diff --git a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_pass_7.html b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_pass_7.html index 6ee3888e7..742693ff2 100644 --- a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_pass_7.html +++ b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_pass_7.html @@ -15,30 +15,7 @@ UnitTest = { ruleIds: ["text_contrast_sufficient"], results: [ - { - "ruleId": "text_contrast_sufficient", - "value": [ - "INFORMATION", - "FAIL" - ], - "path": { - "dom": "/html[1]/body[1]/p[1]", - "aria": "/document[1]/paragraph[1]" - }, - "reasonId": "Fail_1", - "message": "Text contrast of 3.66 with its background is less than the WCAG AA minimum requirements for text of size 16px and weight of 400", - "messageArgs": [ - "3.66", - 16, - 400, - "#000000", - "#666666", - false, - false - ], - "apiArgs": [], - "category": "Accessibility" - } + ] } diff --git a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/special-chars-1.html b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/special-chars-1.html index c55c292c6..a7971ca95 100644 --- a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/special-chars-1.html +++ b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/special-chars-1.html @@ -8,10 +8,10 @@

- ----=====++++++++___________****a*******%%%%%%%%%%%±±±±@@@@@@@@ + ----=====++++++++___________****a***** **%%%%%%%%%% #%±±±±@@@@@@@@

- ----=====++++++++___________***********%%%%%%%%%%%±±±±@@@@@@@@ + **%%%%%%%%%----=====++++++++___________******* ****%%%%%%% %%%%±±±±@@@@@@@@