Fix test cases and improve test from custom modal

This commit is contained in:
RcleydsonR
2023-02-10 17:09:11 -03:00
parent 03c7d14b4b
commit 3346b96f18
4 changed files with 46 additions and 20 deletions

View File

@@ -0,0 +1,27 @@
import { mount } from "@vue/test-utils";
import CustomModal from "../CustomModal.vue";
describe("CustomModal test", () => {
test("Test custom modal when receive is redirect modal props as false", () => {
const wrapper = mount(CustomModal, {
props: {
isRedirectModal: false,
},
});
expect(wrapper.html()).toContain("ATENÇÃO!");
expect(wrapper.html()).toContain("Entendi");
});
test("Test custom modal when receive is redirect modal props as true", () => {
const wrapper = mount(CustomModal, {
props: {
isRedirectModal: true,
},
});
expect(wrapper.html()).toContain("Retomar a última compra?");
expect(wrapper.html()).toContain("Não");
expect(wrapper.html()).toContain("Sim");
});
});

View File

@@ -1,10 +1,10 @@
<script setup lang="ts">
import { pix } from "../utils/QrCodePix";
import { pix } from "@/utils/QrCodePix";
import { ref } from "vue";
import { debounce } from "@/utils/debounce";
import CustomButton from "./CustomButton/CustomButton.vue";
import CustomModal from "./CustomModal.vue";
import api from "../services/index";
import CustomButton from "@/components/CustomButton/CustomButton.vue";
import CustomModal from "@/components//CustomModal/CustomModal.vue";
import api from "@/services/index";
// props and store references
const props = defineProps({