
committed by
Andrew Kushnir

parent
148a060daa
commit
7a86a32040
@ -146,6 +146,13 @@ describe('completions', () => {
|
||||
const completions = ngLS.getCompletionsAt(TEST_TEMPLATE, marker.start);
|
||||
expectContain(completions, CompletionKind.PROPERTY, ['id', 'name']);
|
||||
});
|
||||
|
||||
it('should work with dot notation if stringIndexType is a primitive type', () => {
|
||||
mockHost.override(TEST_TEMPLATE, `{{ primitiveIndexType.test.~{string-primitive-type}}}`);
|
||||
const marker = mockHost.getLocationMarkerFor(TEST_TEMPLATE, 'string-primitive-type');
|
||||
const completions = ngLS.getCompletionsAt(TEST_TEMPLATE, marker.start);
|
||||
expectContain(completions, CompletionKind.METHOD, ['substring']);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -173,10 +173,9 @@ describe('diagnostics', () => {
|
||||
.toBe(`Identifier 'badProperty' is not defined. 'Hero' does not contain such a member`);
|
||||
});
|
||||
|
||||
it('should not produce errors with dot notation if stringIndexType is js primitive type',
|
||||
it('should not produce errors with dot notation if stringIndexType is a primitive type',
|
||||
() => {
|
||||
mockHost.override(TEST_TEMPLATE, `
|
||||
{{primitiveType.test}}`);
|
||||
mockHost.override(TEST_TEMPLATE, `{{primitiveIndexType.test}}`);
|
||||
const diags = ngLS.getDiagnostics(TEST_TEMPLATE);
|
||||
expect(diags.length).toBe(0);
|
||||
});
|
||||
|
@ -192,7 +192,7 @@ export class TemplateReference {
|
||||
tupleArray: [string, Hero] = ['test', this.hero];
|
||||
league: Hero[][] = [this.heroes];
|
||||
heroesByName: {[name: string]: Hero} = {};
|
||||
primitiveType: {[name: string]: string} = {};
|
||||
primitiveIndexType: {[name: string]: string} = {};
|
||||
anyValue: any;
|
||||
myClick(event: any) {}
|
||||
}
|
||||
|
Reference in New Issue
Block a user