From 5de3aa1a6adc93dd6abe6b87ec05962efeafc392 Mon Sep 17 00:00:00 2001 From: Alex Grozav Date: Sun, 3 Apr 2022 10:09:56 +0300 Subject: [PATCH] fix: Fixed vue provide/inject tests. --- packages/vue/src/__tests__/defineComponent.spec.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/vue/src/__tests__/defineComponent.spec.tsx b/packages/vue/src/__tests__/defineComponent.spec.tsx index 3344585..22cab74 100644 --- a/packages/vue/src/__tests__/defineComponent.spec.tsx +++ b/packages/vue/src/__tests__/defineComponent.spec.tsx @@ -1,6 +1,6 @@ import { describe, it, expect, vi } from 'vitest'; import { render, fireEvent } from '@testing-library/vue'; -import { defineComponent, h, ref, inject, provide, Events } from '../index'; +import { defineComponent, h, ref, Events } from '../index'; describe('vue', () => { describe('defineComponent()', () => { @@ -290,7 +290,7 @@ describe('vue', () => { const identifier = Symbol('provide'); const Provider = defineComponent({ setup (props, ctx) { - provide(identifier, 'value'); + ctx.provide(identifier, 'value'); return {}; }, @@ -301,7 +301,7 @@ describe('vue', () => { const Consumer = defineComponent({ setup (props, ctx) { - const providedValue = inject(identifier); + const providedValue = ctx.inject(identifier); return { providedValue }; }, @@ -325,7 +325,7 @@ describe('vue', () => { const count = ref(0); const onClick = () => { count.value += 1; }; - provide(identifier, count); + ctx.provide(identifier, count); return { onClick }; }, @@ -336,7 +336,7 @@ describe('vue', () => { const Consumer = defineComponent({ setup (props, ctx) { - const providedValue = inject(identifier); + const providedValue = ctx.inject(identifier); return { providedValue }; },