Skip to content

Commit

Permalink
fix: Fixed vue provide/inject tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgrozav committed Apr 3, 2022
1 parent fc965cc commit 5de3aa1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/vue/src/__tests__/defineComponent.spec.tsx
Original file line number Diff line number Diff line change
@@ -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()', () => {
Expand Down Expand Up @@ -290,7 +290,7 @@ describe('vue', () => {
const identifier = Symbol('provide');
const Provider = defineComponent({
setup (props, ctx) {
provide(identifier, 'value');
ctx.provide(identifier, 'value');

return {};
},
Expand All @@ -301,7 +301,7 @@ describe('vue', () => {

const Consumer = defineComponent({
setup (props, ctx) {
const providedValue = inject(identifier);
const providedValue = ctx.inject(identifier);

return { providedValue };
},
Expand All @@ -325,7 +325,7 @@ describe('vue', () => {
const count = ref(0);
const onClick = () => { count.value += 1; };

provide(identifier, count);
ctx.provide(identifier, count);

return { onClick };
},
Expand All @@ -336,7 +336,7 @@ describe('vue', () => {

const Consumer = defineComponent({
setup (props, ctx) {
const providedValue = inject(identifier);
const providedValue = ctx.inject(identifier);

return { providedValue };
},
Expand Down

0 comments on commit 5de3aa1

Please sign in to comment.