Skip to content

Commit

Permalink
test(runtime-vapor): tidy custom directives test
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed Nov 15, 2024
1 parent 30f6eec commit 886440d
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 853 deletions.
8 changes: 4 additions & 4 deletions packages/runtime-vapor/__tests__/apiCreateVaporApp.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ describe('api: createVaporApp', () => {
expect(host.innerHTML).toBe(`foobar!barbaz!`)
})

test.todo('directive', () => {
test('directive', () => {
const spy1 = vi.fn()
const spy2 = vi.fn()

Expand All @@ -167,12 +167,12 @@ describe('api: createVaporApp', () => {
},
}).create()

const FooBar = { mounted: spy1 }
const FooBar = spy1
app.directive('FooBar', FooBar)
expect(app.directive('FooBar')).toBe(FooBar)

app.directive('BarBaz', { mounted: spy2 })
app.directive('BarBaz', { mounted: spy2 })
app.directive('BarBaz', spy2)
app.directive('BarBaz', spy2)
expect(
'Directive "BarBaz" has already been registered in target app.',
).toHaveBeenWarnedTimes(1)
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime-vapor/__tests__/apiSetupContext.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ describe('api: setup context', () => {
const Wrapper = defineComponent({
setup(_) {
const n0 = createSlot('default')
setInheritAttrs(false, true)
setInheritAttrs(true)
return n0
},
})
Expand Down
Loading

0 comments on commit 886440d

Please sign in to comment.