fix test and build ci to deploy app correctly

This commit is contained in:
RcleydsonR 2023-02-13 12:58:57 -03:00
parent c27dde4dfe
commit 5972f24f4e
4 changed files with 16 additions and 34 deletions

View File

@ -56,6 +56,7 @@ const emit = defineEmits(["makeAnotherTransaction"]);
</div>
<div class="w-full max-w-4xl lg-view">
<ListingComponent
:deposit-list="[]"
:walletTransactions="lastWalletReleaseTransactions"
:isManageMode="false"
>

View File

@ -150,7 +150,7 @@ showInitialItems();
v-for="item in itemsToShow"
:key="item.blockNumber"
>
<div class="flex justify-between items-center">
<div class="item-container">
<div>
<p class="text-sm leading-5 font-medium text-gray-600">
{{ getEventName((item as Event).event) }}
@ -238,6 +238,10 @@ p {
@apply flex flex-col items-center justify-center gap-4;
}
.item-container {
@apply flex justify-between items-center;
}
.text {
@apply text-white text-center;
}

View File

@ -13,6 +13,7 @@ describe("ListingComponent.vue", () => {
test("Test Message when an empty array is received", () => {
const wrapper = mount(ListingComponent, {
props: {
depositList: [],
walletTransactions: [],
isManageMode: true,
},
@ -21,42 +22,16 @@ describe("ListingComponent.vue", () => {
expect(wrapper.html()).toContain("Não há nenhuma transação anterior");
});
test("Test Headers on List in Manage Mode", () => {
const wrapper = mount(ListingComponent, {
props: {
walletTransactions: MockValidDeposits,
isManageMode: true,
},
});
expect(wrapper.html()).toContain("Valor");
expect(wrapper.html()).toContain("Data");
expect(wrapper.html()).toContain("Retirar tokens");
});
test("Test Headers on List in Unmanage Mode", () => {
const wrapper = mount(ListingComponent, {
props: {
walletTransactions: MockEvents,
isManageMode: false,
},
});
expect(wrapper.html()).toContain("Valor");
expect(wrapper.html()).toContain("Data");
expect(wrapper.html()).toContain("Tipo de transação");
expect(wrapper.html()).toContain("Checar transação");
});
test("Test number of elements in the list first render", () => {
const wrapper = mount(ListingComponent, {
props: {
depositList: [],
walletTransactions: MockEvents,
isManageMode: false,
},
});
const elements = wrapper.findAll(".transaction-date");
const elements = wrapper.findAll(".item-container");
expect(elements).toHaveLength(3);
});
@ -64,18 +39,19 @@ describe("ListingComponent.vue", () => {
test("Test load more button behavior", async () => {
const wrapper = mount(ListingComponent, {
props: {
depositList: [],
walletTransactions: MockValidDeposits,
isManageMode: false,
},
});
const btn = wrapper.find("button");
let elements = wrapper.findAll(".transaction-date");
let elements = wrapper.findAll(".item-container");
expect(elements).toHaveLength(3);
await btn.trigger("click");
elements = wrapper.findAll(".transaction-date");
elements = wrapper.findAll(".item-container");
expect(elements).toHaveLength(5);
});
@ -83,14 +59,15 @@ describe("ListingComponent.vue", () => {
test("Test withdraw offer button emit", async () => {
const wrapper = mount(ListingComponent, {
props: {
depositList: MockValidDeposits,
walletTransactions: MockValidDeposits,
isManageMode: true,
},
});
wrapper.vm.$emit("withdrawDeposit");
wrapper.vm.$emit("depositWithdrawn");
await wrapper.vm.$nextTick();
expect(wrapper.emitted("withdrawDeposit")).toBeTruthy();
expect(wrapper.emitted("depositWithdrawn")).toBeTruthy();
});
});

View File

@ -30,6 +30,6 @@ describe("TopBar.vue", () => {
it("should render the P2Pix logo correctly", () => {
const wrapper = shallowMount(TopBar);
const img = wrapper.findAll(".logo");
expect(img.length).toBe(1);
expect(img.length).toBe(2);
});
});