diff --git a/packages/language-service/test/completions_spec.ts b/packages/language-service/test/completions_spec.ts index ec8c6c32fe..e2795dab59 100644 --- a/packages/language-service/test/completions_spec.ts +++ b/packages/language-service/test/completions_spec.ts @@ -372,9 +372,10 @@ describe('completions', () => { describe('data binding', () => { it('should be able to complete property value', () => { - const marker = mockHost.getLocationMarkerFor(PARSING_CASES, 'property-binding-model'); - const completions = ngLS.getCompletionsAt(PARSING_CASES, marker.start); - expectContain(completions, CompletionKind.PROPERTY, ['test']); + mockHost.override(TEST_TEMPLATE, `
`); + const marker = mockHost.getLocationMarkerFor(TEST_TEMPLATE, 'cursor'); + const completions = ngLS.getCompletionsAt(TEST_TEMPLATE, marker.start); + expectContain(completions, CompletionKind.PROPERTY, ['title']); }); it('should be able to complete property read', () => { @@ -385,9 +386,10 @@ describe('completions', () => { }); it('should be able to complete an event', () => { - const marker = mockHost.getLocationMarkerFor(PARSING_CASES, 'event-binding-model'); - const completions = ngLS.getCompletionsAt(PARSING_CASES, marker.start); - expectContain(completions, CompletionKind.METHOD, ['modelChanged']); + mockHost.override(TEST_TEMPLATE, ``); + const marker = mockHost.getLocationMarkerFor(TEST_TEMPLATE, 'cursor'); + const completions = ngLS.getCompletionsAt(TEST_TEMPLATE, marker.start); + expectContain(completions, CompletionKind.METHOD, ['myClick']); }); it('should be able to complete a the LHS of a two-way binding', () => { @@ -398,9 +400,10 @@ describe('completions', () => { }); it('should be able to complete a the RHS of a two-way binding', () => { - const marker = mockHost.getLocationMarkerFor(PARSING_CASES, 'two-way-binding-model'); - const completions = ngLS.getCompletionsAt(PARSING_CASES, marker.start); - expectContain(completions, CompletionKind.PROPERTY, ['test']); + mockHost.override(TEST_TEMPLATE, ``); + const marker = mockHost.getLocationMarkerFor(TEST_TEMPLATE, 'cursor'); + const completions = ngLS.getCompletionsAt(TEST_TEMPLATE, marker.start); + expectContain(completions, CompletionKind.PROPERTY, ['title']); }); it('should suggest property binding for input', () => { diff --git a/packages/language-service/test/project/app/main.ts b/packages/language-service/test/project/app/main.ts index 701780c7c4..defe0c4372 100644 --- a/packages/language-service/test/project/app/main.ts +++ b/packages/language-service/test/project/app/main.ts @@ -30,21 +30,17 @@ import * as ParsingCases from './parsing-cases'; NgForCases.UnknownTrackBy, NgIfCases.ShowIf, ParsingCases.AsyncForUsingComponent, - ParsingCases.AttributeBinding, ParsingCases.CaseIncompleteOpen, ParsingCases.CaseMissingClosing, ParsingCases.CaseUnknown, ParsingCases.EmptyInterpolation, - ParsingCases.EventBinding, ParsingCases.NoValueAttribute, ParsingCases.NumberModel, ParsingCases.Pipes, - ParsingCases.PropertyBinding, ParsingCases.References, ParsingCases.StringModel, ParsingCases.TemplateReference, ParsingCases.TestComponent, - ParsingCases.TwoWayBinding, ] }) export class AppModule { diff --git a/packages/language-service/test/project/app/parsing-cases.ts b/packages/language-service/test/project/app/parsing-cases.ts index 235982f3d1..4ed8c4c787 100644 --- a/packages/language-service/test/project/app/parsing-cases.ts +++ b/packages/language-service/test/project/app/parsing-cases.ts @@ -44,39 +44,6 @@ export class Pipes { export class NoValueAttribute { } - -@Component({ - template: '', -}) -export class AttributeBinding { - test: string = 'test'; -} - -@Component({ - template: '', -}) -export class PropertyBinding { - test: string = 'test'; -} - -@Component({ - template: '', -}) -export class EventBinding { - test: string = 'test'; - - modelChanged() {} -} - -@Component({ - template: ` - - `, -}) -export class TwoWayBinding { - test: string = 'test'; -} - @Directive({ selector: '[string-model]', }) diff --git a/packages/language-service/test/typescript_host_spec.ts b/packages/language-service/test/typescript_host_spec.ts index 816bb81f34..0352a19067 100644 --- a/packages/language-service/test/typescript_host_spec.ts +++ b/packages/language-service/test/typescript_host_spec.ts @@ -94,7 +94,7 @@ describe('TypeScriptServiceHost', () => { const tsLS = ts.createLanguageService(tsLSHost); const ngLSHost = new TypeScriptServiceHost(tsLSHost, tsLS); const templates = ngLSHost.getTemplates('/app/parsing-cases.ts'); - expect(templates.length).toBe(13); + expect(templates.length).toBe(9); }); it('should be able to find external template', () => {