Skip to content

Commit

Permalink
fix: use correct type
Browse files Browse the repository at this point in the history
  • Loading branch information
arnoson committed Feb 21, 2023
1 parent 3803a96 commit 66d8049
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import {
registerComponent,
mountComponent,
mountComponents,
defineProps
defineProps,
SimpleElement
} from '../src'

it('mounts a component', () => {
Expand Down Expand Up @@ -162,11 +163,13 @@ it('interferes prop types from default values', () => {

it(`exposes the component function's return value`, () => {
const exposed = { test: () => {} }
registerComponent('test', () => exposed)
const component = registerComponent('test', () => exposed)

document.body.innerHTML = `
<div data-simple-component="test" id="my-id"></div>
`

mountComponents(document.body)
expect(document.getElementById('my-id')?.$component).toBe(exposed)
const el = document.getElementById('my-id') as SimpleElement<typeof component>
expect(el.$component).toBe(exposed)
})

0 comments on commit 66d8049

Please sign in to comment.