This commit is contained in:
NoryiE
2025-02-10 06:00:28 +00:00
parent b0a4a6da9c
commit 71a1fce096
2428 changed files with 0 additions and 1005324 deletions

View File

@@ -1,38 +0,0 @@
'use strict';
describe(
'mark with acrossElements, regular expression and ignoreGroups',
function() {
var $ctx1, $ctx2, prefix = 'across-elements-regexp';
beforeEach(function(done) {
loadFixtures('across-elements/regexp/ignore-groups.html');
$ctx1 = $('.' + prefix + '-ignore-groups > div:first-child');
$ctx2 = $('.' + prefix + '-ignore-groups > div:last-child');
new Mark($ctx1[0]).markRegExp(/(Lor)([^]?m[\s]*)(ipsum)/gmi, {
'acrossElements': true,
'done': function() {
new Mark($ctx2[0]).markRegExp(
/(Lor)([^]?m[\s]*)(ipsum)/gmi, {
'acrossElements': true,
'ignoreGroups': 2,
'done': done
}
);
}
});
});
it('should silently ignore groups when disabled', function() {
expect($ctx1.find('mark')).toHaveLength(4);
$ctx1.find('mark').each(function() {
expect($(this).text()).toBe('Lorem ipsum');
});
});
it('should ignore specified groups when enabled', function() {
expect($ctx2.find('mark')).toHaveLength(4);
$ctx2.find('mark').each(function() {
expect($(this).text()).toBe('ipsum');
});
});
}
);