diff --git a/src/components/CustomModal.vue b/src/components/CustomModal/CustomModal.vue similarity index 100% rename from src/components/CustomModal.vue rename to src/components/CustomModal/CustomModal.vue diff --git a/src/components/CustomModal/__tests__/CustomModal.spec.ts b/src/components/CustomModal/__tests__/CustomModal.spec.ts new file mode 100644 index 0000000..3cb723b --- /dev/null +++ b/src/components/CustomModal/__tests__/CustomModal.spec.ts @@ -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"); + }); +}); diff --git a/src/components/QrCodeComponent.vue b/src/components/QrCodeComponent.vue index 7ed347a..3321347 100644 --- a/src/components/QrCodeComponent.vue +++ b/src/components/QrCodeComponent.vue @@ -1,10 +1,10 @@