({
templateOverride,
expectedSpanText,
expectedDisplayString,
}: {
templateOverride: string;
expectedSpanText: string;
expectedDisplayString: string;
})
| 1409 | }); |
| 1410 | |
| 1411 | function expectQuickInfo({ |
| 1412 | templateOverride, |
| 1413 | expectedSpanText, |
| 1414 | expectedDisplayString, |
| 1415 | }: { |
| 1416 | templateOverride: string; |
| 1417 | expectedSpanText: string; |
| 1418 | expectedDisplayString: string; |
| 1419 | }): ts.QuickInfo { |
| 1420 | const text = templateOverride.replace('¦', ''); |
| 1421 | const template = project.openFile('app.html'); |
| 1422 | template.contents = text; |
| 1423 | env.expectNoSourceDiagnostics(); |
| 1424 | |
| 1425 | template.moveCursorToText(templateOverride); |
| 1426 | const quickInfo = template.getQuickInfoAtPosition(); |
| 1427 | expect(quickInfo).toBeTruthy(); |
| 1428 | const {textSpan, displayParts} = quickInfo!; |
| 1429 | expect(text.substring(textSpan.start, textSpan.start + textSpan.length)).toEqual( |
| 1430 | expectedSpanText, |
| 1431 | ); |
| 1432 | expect(toText(displayParts)).toEqual(expectedDisplayString); |
| 1433 | return quickInfo!; |
| 1434 | } |
| 1435 | }); |
| 1436 | |
| 1437 | function toText(displayParts?: ts.SymbolDisplayPart[]): string { |
no test coverage detected