From 49834745a9f1fe5e43ab7073b9834836c4bc4299 Mon Sep 17 00:00:00 2001 From: RcleydsonR Date: Tue, 24 Jan 2023 22:28:02 -0300 Subject: [PATCH] Improve and fix Buy Confirmed Component test --- ...onenet.spec.ts => BuyConfirmedComponent.spec.ts} | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) rename src/components/BuyConfirmedComponent/__tests__/{BuyConfirmedComponenet.spec.ts => BuyConfirmedComponent.spec.ts} (74%) diff --git a/src/components/BuyConfirmedComponent/__tests__/BuyConfirmedComponenet.spec.ts b/src/components/BuyConfirmedComponent/__tests__/BuyConfirmedComponent.spec.ts similarity index 74% rename from src/components/BuyConfirmedComponent/__tests__/BuyConfirmedComponenet.spec.ts rename to src/components/BuyConfirmedComponent/__tests__/BuyConfirmedComponent.spec.ts index 46022fe..829c7e9 100644 --- a/src/components/BuyConfirmedComponent/__tests__/BuyConfirmedComponenet.spec.ts +++ b/src/components/BuyConfirmedComponent/__tests__/BuyConfirmedComponent.spec.ts @@ -1,13 +1,20 @@ -import { mount } from "@vue/test-utils"; +import { shallowMount } from "@vue/test-utils"; import BuyConfirmedComponent from "../BuyConfirmedComponent.vue"; +import { createPinia, setActivePinia } from "pinia"; +import { MockEvents } from "@/model/mock/EventMock"; describe("BuyConfirmedComponent.vue", () => { - const wrapper = mount(BuyConfirmedComponent, { + beforeEach(() => { + setActivePinia(createPinia()); + }); + + const wrapper = shallowMount(BuyConfirmedComponent, { props: { - lastWalletReleaseTransactions: [], + lastWalletReleaseTransactions: MockEvents, tokenAmount: 1, }, }); + test("Test component Header Text", () => { expect(wrapper.html()).toContain("Os tokens já foram transferidos"); expect(wrapper.html()).toContain("para a sua carteira!");