diff --git a/packages/core/test/acceptance/directive_spec.ts b/packages/core/test/acceptance/directive_spec.ts index 31905992e8..d0fee53328 100644 --- a/packages/core/test/acceptance/directive_spec.ts +++ b/packages/core/test/acceptance/directive_spec.ts @@ -172,6 +172,23 @@ describe('directives', () => { expect(nodesWithDirective.length).toBe(1); }); + it('should match classes to directive selectors without case sensitivity', () => { + @Directive({selector: '.Titledir'}) + class TitleClassDirective { + } + + TestBed.configureTestingModule({declarations: [TestComponent, TitleClassDirective]}); + TestBed.overrideTemplate(TestComponent, ` +
+ `); + + const fixture = TestBed.createComponent(TestComponent); + const nodesWithDirective = + fixture.debugElement.queryAllNodes(By.directive(TitleClassDirective)); + + expect(nodesWithDirective.length).toBe(1); + }); + it('should NOT match classes to directive selectors', () => { TestBed.configureTestingModule({declarations: [TestComponent, TitleDirective]}); TestBed.overrideTemplate(TestComponent, ` @@ -184,6 +201,23 @@ describe('directives', () => { expect(nodesWithDirective.length).toBe(0); }); + it('should match attributes to directive selectors without case sensitivity', () => { + @Directive({selector: '[title=Titledir]'}) + class TitleAttributeDirective { + } + + TestBed.configureTestingModule({declarations: [TestComponent, TitleAttributeDirective]}); + TestBed.overrideTemplate(TestComponent, ` + + `); + + const fixture = TestBed.createComponent(TestComponent); + const nodesWithDirective = + fixture.debugElement.queryAllNodes(By.directive(TitleAttributeDirective)); + + expect(nodesWithDirective.length).toBe(1); + }); + it('should match directives with attribute selectors on outputs', () => { @Directive({selector: '[out]'}) class TestDir {