From 98b040472de06c110455b2475bee13ab7717394b Mon Sep 17 00:00:00 2001 From: Alireza Heidari Date: Wed, 28 Feb 2024 17:12:16 +0100 Subject: [PATCH 01/16] =?UTF-8?q?=F0=9F=9B=A0=EF=B8=8F:=20refactor=20`entr?= =?UTF-8?q?y/analysis/modules/Login.vue`=20to=20composition=20API=20and=20?= =?UTF-8?q?`typeScript`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/entry/analysis/modules/Login.vue | 57 ++++++++++----------- 1 file changed, 27 insertions(+), 30 deletions(-) diff --git a/client/src/entry/analysis/modules/Login.vue b/client/src/entry/analysis/modules/Login.vue index 3555469d2f0a..bb5065992143 100644 --- a/client/src/entry/analysis/modules/Login.vue +++ b/client/src/entry/analysis/modules/Login.vue @@ -1,18 +1,39 @@ + + - - From e0eb3867844068c240bf0f619f5fe6c547368f07 Mon Sep 17 00:00:00 2001 From: Alireza Heidari Date: Wed, 28 Feb 2024 17:21:31 +0100 Subject: [PATCH 02/16] =?UTF-8?q?=F0=9F=9B=A0=EF=B8=8F:=20refactor=20`Logi?= =?UTF-8?q?nIndex.vue`=20to=20composition=20API=20and=20`typeScript`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/components/Login/LoginIndex.vue | 119 +++++++-------------- 1 file changed, 39 insertions(+), 80 deletions(-) diff --git a/client/src/components/Login/LoginIndex.vue b/client/src/components/Login/LoginIndex.vue index 3d9d79abf828..c74cc7a54fe9 100644 --- a/client/src/components/Login/LoginIndex.vue +++ b/client/src/components/Login/LoginIndex.vue @@ -1,3 +1,42 @@ + + - From 549d658c2f25216361aa30557c54cad9facd3b40 Mon Sep 17 00:00:00 2001 From: Alireza Heidari Date: Wed, 28 Feb 2024 17:33:26 +0100 Subject: [PATCH 03/16] =?UTF-8?q?=F0=9F=9B=A0=EF=B8=8F:=20refactor=20`Regi?= =?UTF-8?q?sterForm.vue`=20to=20composition=20API=20and=20`typeScript`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/components/Login/RegisterForm.vue | 331 +++++++++---------- 1 file changed, 165 insertions(+), 166 deletions(-) diff --git a/client/src/components/Login/RegisterForm.vue b/client/src/components/Login/RegisterForm.vue index 0a8e9d31a3f2..8fab303e6bc5 100644 --- a/client/src/components/Login/RegisterForm.vue +++ b/client/src/components/Login/RegisterForm.vue @@ -1,86 +1,188 @@ + + - - From 68e6f4c03c4324afcdf9b68a259b6cef33f050be Mon Sep 17 00:00:00 2001 From: Alireza Heidari Date: Wed, 28 Feb 2024 18:21:59 +0100 Subject: [PATCH 04/16] =?UTF-8?q?=F0=9F=9B=A0=EF=B8=8F:=20refactor=20`Regi?= =?UTF-8?q?sterForm`=20tests=20to=20`typeScript`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...isterForm.test.js => RegisterForm.test.ts} | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) rename client/src/components/Login/{RegisterForm.test.js => RegisterForm.test.ts} (72%) diff --git a/client/src/components/Login/RegisterForm.test.js b/client/src/components/Login/RegisterForm.test.ts similarity index 72% rename from client/src/components/Login/RegisterForm.test.js rename to client/src/components/Login/RegisterForm.test.ts index ffd81fccbfba..db5c2ee1083a 100644 --- a/client/src/components/Login/RegisterForm.test.js +++ b/client/src/components/Login/RegisterForm.test.ts @@ -1,19 +1,20 @@ -import { mount } from "@vue/test-utils"; +import { getLocalVue } from "@tests/jest/helpers"; +import { mount, Wrapper } from "@vue/test-utils"; import axios from "axios"; import MockAdapter from "axios-mock-adapter"; -import { getLocalVue } from "tests/jest/helpers"; -import MountTarget from "./RegisterForm"; +import MountTarget from "./RegisterForm.vue"; const localVue = getLocalVue(true); describe("RegisterForm", () => { - let wrapper; - let axiosMock; + let wrapper: Wrapper; + let axiosMock: MockAdapter; beforeEach(() => { axiosMock = new MockAdapter(axios); - wrapper = mount(MountTarget, { + + wrapper = mount(MountTarget as object, { propsData: { sessionCsrfToken: "sessionCsrfToken", }, @@ -27,18 +28,23 @@ describe("RegisterForm", () => { it("basics", async () => { const cardHeader = wrapper.find(".card-header"); - expect(cardHeader.text()).toBeLocalizationOf("Create a Galaxy account"); + (expect(cardHeader.text()) as any).toBeLocalizationOf("Create a Galaxy account"); + const inputs = wrapper.findAll("input"); expect(inputs.length).toBe(4); + const usernameField = inputs.at(0); expect(usernameField.attributes("type")).toBe("text"); await usernameField.setValue("test_user"); + const pwdField = inputs.at(1); expect(pwdField.attributes("type")).toBe("password"); await pwdField.setValue("test_pwd"); + const submitButton = wrapper.find("button[type='submit']"); await submitButton.trigger("submit"); - const postedData = JSON.parse(axiosMock.history.post[0].data); + + const postedData = JSON.parse(axiosMock.history.post?.[0]?.data); expect(postedData.email).toBe("test_user"); expect(postedData.password).toBe("test_pwd"); }); From bf60535d2f421c1e613135edd334fe24f4184f97 Mon Sep 17 00:00:00 2001 From: Alireza Heidari Date: Wed, 28 Feb 2024 17:52:40 +0100 Subject: [PATCH 05/16] =?UTF-8?q?=F0=9F=9B=A0=EF=B8=8F:=20refactor=20`Logi?= =?UTF-8?q?nForm.vue`=20to=20composition=20API=20and=20`typeScript`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/components/Login/LoginForm.vue | 345 +++++++++++----------- 1 file changed, 175 insertions(+), 170 deletions(-) diff --git a/client/src/components/Login/LoginForm.vue b/client/src/components/Login/LoginForm.vue index 626265bf1c9a..5278e7221d84 100644 --- a/client/src/components/Login/LoginForm.vue +++ b/client/src/components/Login/LoginForm.vue @@ -1,47 +1,192 @@ + + - -