Skip to content

Commit

Permalink
chore(traversing): Add test case for lowerCaseTags (#3981)
Browse files Browse the repository at this point in the history
Fixes #3495
  • Loading branch information
fb55 committed Aug 8, 2024
1 parent b824ba8 commit eb7122b
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/api/traversing.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,25 @@ describe('$(...)', () => {
}).toThrow('Unknown pseudo-class :bah');
});

it('should respect the `lowerCaseTags` option (#3495)', () => {
const q = load(
`<parentTag class="myClass">
<firstTag> <child> blah </child> </firstTag>
<secondTag> <child> blah </child> </secondTag>
</parentTag> `,
{
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);
Expand Down

0 comments on commit eb7122b

Please sign in to comment.