From 4eb15b5ebf9e59801024cef64455bce99e15f835 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Fri, 28 Oct 2022 17:17:29 +0200 Subject: [PATCH] Fix E2E tests for login Signed-off-by: Thomas Citharel --- .gitlab-ci.yml | 3 ++- js/src/views/User/LoginView.vue | 14 ++++++++------ js/tests/e2e/login.spec.ts | 4 +++- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3211e149..6ad4a1b3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -169,7 +169,8 @@ e2e: artifacts: expire_in: 2 days paths: - - js/playwright-report + - js/playwright-report/ + - js/test-results/ pages: stage: deploy diff --git a/js/src/views/User/LoginView.vue b/js/src/views/User/LoginView.vue index 78a89be3..53796faf 100644 --- a/js/src/views/User/LoginView.vue +++ b/js/src/views/User/LoginView.vue @@ -100,12 +100,7 @@ }" >{{ t("Didn't receive the instructions?") }} -

+

configResult.value?.config); +const canRegister = computed(() => { + return ( + (config.value?.registrationsOpen || config.value?.registrationsAllowlist) && + config.value?.auth.databaseLogin + ); +}); + const errors = ref([]); const submitted = ref(false); diff --git a/js/tests/e2e/login.spec.ts b/js/tests/e2e/login.spec.ts index f7f11dc6..85ecc31e 100644 --- a/js/tests/e2e/login.spec.ts +++ b/js/tests/e2e/login.spec.ts @@ -14,7 +14,9 @@ test("Login has everything we need", async ({ page }) => { hasText: "Didn't receive the instructions?", }); - const registerLink = page.locator("a", { hasText: "Create an account" }); + const registerLink = page.locator("a > span > span", { + hasText: "Create an account", + }); await expect(forgotPasswordLink).toBeVisible(); await expect(reAskInstructionsLink).toBeVisible();