From eb7122bbad4ce932457b7f9a878601b6732cce42 Mon Sep 17 00:00:00 2001 From: Felix Boehm <188768+fb55@users.noreply.github.com> Date: Thu, 8 Aug 2024 09:19:40 +0100 Subject: [PATCH] chore(traversing): Add test case for `lowerCaseTags` (#3981) Fixes #3495 --- src/api/traversing.spec.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/api/traversing.spec.ts b/src/api/traversing.spec.ts index 3494b6f9ab..b57baf6b32 100644 --- a/src/api/traversing.spec.ts +++ b/src/api/traversing.spec.ts @@ -104,6 +104,25 @@ describe('$(...)', () => { }).toThrow('Unknown pseudo-class :bah'); }); + it('should respect the `lowerCaseTags` option (#3495)', () => { + const q = load( + ` + blah + blah + `, + { + xml: { + xmlMode: true, + decodeEntities: false, + lowerCaseTags: true, + lowerCaseAttributeNames: false, + recognizeSelfClosing: true, + }, + }, + ); + expect(q('.myClass').find('firstTag > child')).toHaveLength(1); + }); + describe('(cheerio object) :', () => { it('returns only those nodes contained within the current selection', () => { const q = load(food);