Skip to content

Commit fb56224

Browse files
committed
test(Highlight): Adding a test for activating non-existent group.
1 parent da3972f commit fb56224

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

projects/igniteui-angular/src/lib/directives/text-highlight/text-highlight.directive.spec.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,17 @@ describe('IgxHighlight', () => {
299299
expect(() => component.highlight.activateIfNecessary()).not.toThrowError();
300300
});
301301

302+
it('Should not throw when attempting to activate a non-existing group.', () => {
303+
const fix = TestBed.createComponent(HighlightLoremIpsumComponent);
304+
fix.detectChanges();
305+
306+
const component: HighlightLoremIpsumComponent = fix.debugElement.componentInstance;
307+
component.highlightText('a');
308+
component.groupName = 'test1';
309+
fix.detectChanges();
310+
311+
expect(() => component.highlight.activateIfNecessary()).not.toThrowError();
312+
});
302313
});
303314

304315
@Component({

0 commit comments

Comments
 (0)