Skip to content

Commit 6ec0ea7

Browse files
committed
fix tests
1 parent 29efd10 commit 6ec0ea7

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

test/audits/readability/analysis-utils.test.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1382,6 +1382,20 @@ Save it for your next mountain escape!
13821382
expect(normalizeReadabilityText(123)).to.equal('');
13831383
});
13841384
});
1385+
1386+
describe('isLikelyNavigationElement (direct module import)', () => {
1387+
it('returns true when a descendant matches navHdr / nav-hdr paragraph selectors', async () => {
1388+
const { isLikelyNavigationElement } = await import('../../../src/readability/shared/analysis-utils.js');
1389+
const $ = cheerioLoad(`
1390+
<div id="region">
1391+
<p class="navHdr">Shop categories</p>
1392+
<p id="sibling">Other marketing copy in the same container as the nav header row.</p>
1393+
</div>
1394+
`);
1395+
const region = $('#region').get(0);
1396+
expect(isLikelyNavigationElement($, region)).to.equal(true);
1397+
});
1398+
});
13851399
});
13861400

13871401
describe('embed-content-utils (unit)', () => {

0 commit comments

Comments
 (0)