/
kochenov
/
universal-modular
Обзор
Документация
Войти
/
kochenov
/
universal-modular
Код
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
node_modules/mark.js/test/specs/basic/nested-mark.js
52 строки
2 KB
Kochenov Dmitry
feat(foundation): Шаг 1.3 — Установить Node.js 24 + VitePress + настроить конфигурацию
10 июл 2026, 11:06
10 июл 2026, 11:06
70eff21
Код
Авторство
О чём код?
'use strict'; describe( 'basic mark in already marked element', function() { var $ctx, instance; beforeEach(function(done) { loadFixtures('basic/nested-mark.html'); $ctx = $('.basic-nested-mark'); instance = new Mark($ctx[0]); instance.mark('lorem test ipsum', { 'diacritics': false, 'separateWordSearch': false, 'className': 'root', 'done': function() { instance.mark('test', { 'diacritics': false, 'separateWordSearch': false, 'className': 'nested', 'done': done }); } }); }); it('should wrap matches even in already marked elements', function() { expect($ctx.find('mark')).toHaveLength(5); expect($ctx.find('mark.root')).toHaveLength(2); expect($ctx.find('mark.nested')).toHaveLength(3); expect($ctx.find('mark.root')).toContainElement('mark.nested'); expect($ctx.find('mark.root')).toContainText('lorem test ipsum'); expect($ctx.find('mark.nested')).toContainText('test'); }); it('should unwrap nested mark elements correctly', function(done) { instance.unmark({ 'className': 'root', 'done': function() { expect($ctx.find('mark.root')).not.toExist(); expect($ctx.find('mark.nested')).toHaveLength(3); expect($ctx.find('mark.nested')).toContainText('test'); instance.unmark({ 'className': 'nested', 'done': function() { expect($ctx.find('mark.nested')).not.toExist(); done(); } }); } }); }); } );