Skip to content

Commit 99bbec5

Browse files
committed
test: add test
1 parent 8df75d6 commit 99bbec5

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

packages/compiler-sfc/__tests__/compileScript/resolveType.spec.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,22 @@ describe('resolveType', () => {
731731
})
732732
})
733733

734+
test('TSMappedType with indexed access', () => {
735+
const { props } = resolve(
736+
`
737+
type Prettify<T> = { [K in keyof T]: T[K] } & {}
738+
type Side = 'top' | 'right' | 'bottom' | 'left'
739+
type AlignedPlacement = \`\${Side}-\${Alignment}\`
740+
type Alignment = 'start' | 'end'
741+
type Placement = Prettify<Side | AlignedPlacement>
742+
defineProps<{placement?: Placement}>()
743+
`,
744+
)
745+
expect(props).toStrictEqual({
746+
placement: ['String', 'Object'],
747+
})
748+
})
749+
734750
describe('type alias declaration', () => {
735751
// #13240
736752
test('function type', () => {

0 commit comments

Comments
 (0)