From 77c7c8ecad1d51f9221fc66a0821ca58c51d27c7 Mon Sep 17 00:00:00 2001 From: HuanWuCode Date: Sun, 22 Sep 2024 17:52:35 -0700 Subject: [PATCH 1/2] Update README.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update the doc for clarity and consistency with present tense. Also, "rules' description and help properties as well as each checks' metadata.messages property" → should be "rule's description and help properties, as well as each check's metadata.messages property" (singular possessive for "rule" and "check," and add a comma before "as well as"). --- locales/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locales/README.md b/locales/README.md index 059e4db108..e95913324c 100644 --- a/locales/README.md +++ b/locales/README.md @@ -2,8 +2,8 @@ We welcome any localization for axe-core. For details on how to contribute, see the [Contributing section](../README.md#contributing) of the main README. For details on the message syntax, see [Check Message Template](../doc/check-message-template.md). -To create a new translation for axe, start by running `grunt translate --lang=`. This will create a json file with the default English text in it for you to translate. Alternatively, you could copy `_template.json`. +To create a new translation for axe, start by running `grunt translate --lang=`. This will create a JSON file with the default English text in it for you to translate. Alternatively, you could copy `_template.json`. -To update an existing translation file, re-run `grunt translate --lang=`. This will add new messages used in English and remove messages which were not used in English. +To update an existing translation file, re-run `grunt translate --lang=`. This will add new messages used in English and remove messages that are no longer used in English. -`_template.json` is a generated file which is created every time axe is built. It's compiled using each rules' `description` and `help` properties as well as each checks' `metadata.messages` property. To update the `_template.json` file you'll need to update the corresponding [rule](../lib/rules) or [check](../lib/checks) metadata file and rebuild. +`_template.json` is a generated file which is created every time axe is built. It's compiled using each rule's `description` and `help` properties, as well as each check's `metadata.messages` property. To update the `_template.json` file you'll need to update the corresponding [rule](../lib/rules) or [check](../lib/checks) metadata file and rebuild. From e95ca11db355ec76d197bd37aed07b6a733db1ae Mon Sep 17 00:00:00 2001 From: HuanWuCode Date: Tue, 24 Sep 2024 18:46:54 -0700 Subject: [PATCH 2/2] test: improve heading-matches test cases --- test/rule-matches/heading-matches.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/rule-matches/heading-matches.js b/test/rule-matches/heading-matches.js index 59f8250540..6dcb19e3f9 100644 --- a/test/rule-matches/heading-matches.js +++ b/test/rule-matches/heading-matches.js @@ -6,6 +6,8 @@ describe('heading-matches', function () { beforeEach(function () { rule = axe.utils.getRule('empty-heading'); + assert.isObject(rule, 'Rule object should be available'); + assert.isFunction(rule.matches, 'Rule should have a matches function'); }); it('is a function', function () { @@ -29,22 +31,22 @@ describe('heading-matches', function () { } }); - it('should return false on headings with their role changes', function () { + it('should return false on headings that no longer function as headings due to a valid role change', function () { const vNode = queryFixture('

'); assert.isFalse(rule.matches(null, vNode)); }); - it('should return true on headings with their role changes to an invalid role', function () { + it('should return true on headings with their role changed to an invalid role', function () { const vNode = queryFixture('

'); assert.isTrue(rule.matches(null, vNode)); }); - it('should return true on headings with their role changes to an abstract role', function () { + it('should return true on headings with their role changed to an abstract role', function () { const vNode = queryFixture('

'); assert.isTrue(rule.matches(null, vNode)); }); - it('should return true on headings with explicit role="none" and an empty aria-label to account for presentation conflict resolution', function () { + it('should return true on headings with explicit role="none" and an empty aria-label (handling presentation conflict resolution)', function () { const vNode = queryFixture( '

' );