Improve test cases from components and utils

This commit is contained in:
RcleydsonR
2023-02-06 14:01:03 -03:00
parent c5b16559ff
commit 600510c719
7 changed files with 109 additions and 11 deletions

View File

@@ -10,6 +10,17 @@ describe("ListingComponent.vue", () => {
setActivePinia(createPinia());
});
test("Test Message when an empty array is received", () => {
const wrapper = mount(ListingComponent, {
props: {
walletTransactions: [],
isManageMode: true,
},
});
expect(wrapper.html()).toContain("Não há nenhuma transação anterior");
});
test("Test Headers on List in Manage Mode", () => {
const wrapper = mount(ListingComponent, {
props: {

View File

@@ -0,0 +1,27 @@
import { mount } from "@vue/test-utils";
import LoadingComponent from "../LoadingComponent.vue";
describe("Loading.vue", () => {
test("Test loading content with received props", () => {
const wrapper = mount(LoadingComponent, {
props: {
title: "MockTitle",
message: "MockMessage",
},
});
expect(wrapper.html()).toContain("MockTitle");
expect(wrapper.html()).toContain("MockMessage");
});
test("Test default text if props title isnt passed", () => {
const wrapper = mount(LoadingComponent, {
props: {
message: "MockMessage",
},
});
expect(wrapper.html()).toContain("Confirme em sua carteira");
expect(wrapper.html()).toContain("MockMessage");
});
});