({
templateOverride,
expectedSpanText,
expectedDisplayString,
}: {
templateOverride: string;
expectedSpanText: string;
expectedDisplayString: string;
})
| 1454 | }); |
| 1455 | |
| 1456 | function expectQuickInfo({ |
| 1457 | templateOverride, |
| 1458 | expectedSpanText, |
| 1459 | expectedDisplayString, |
| 1460 | }: { |
| 1461 | templateOverride: string; |
| 1462 | expectedSpanText: string; |
| 1463 | expectedDisplayString: string; |
| 1464 | }): ts.QuickInfo { |
| 1465 | const text = templateOverride.replace('¦', ''); |
| 1466 | const template = project.openFile('app.html'); |
| 1467 | template.contents = text; |
| 1468 | env.expectNoSourceDiagnostics(); |
| 1469 | |
| 1470 | template.moveCursorToText(templateOverride); |
| 1471 | const quickInfo = template.getQuickInfoAtPosition(); |
| 1472 | expect(quickInfo).toBeTruthy(); |
| 1473 | const {textSpan, displayParts} = quickInfo!; |
| 1474 | expect(text.substring(textSpan.start, textSpan.start + textSpan.length)).toEqual( |
| 1475 | expectedSpanText, |
| 1476 | ); |
| 1477 | expect(toText(displayParts)).toEqual(expectedDisplayString); |
| 1478 | return quickInfo!; |
| 1479 | } |
| 1480 | }); |
| 1481 | |
| 1482 | function toText(displayParts?: ts.SymbolDisplayPart[]): string { |
no test coverage detected