diff --git a/tests/testcafe/admin/create-event.test.ts b/tests/testcafe/admin/create-event.test.ts index c396fc1..8c0b43d 100644 --- a/tests/testcafe/admin/create-event.test.ts +++ b/tests/testcafe/admin/create-event.test.ts @@ -20,12 +20,11 @@ test("Logged in user can create event", async t => { const loginForm = Selector("form.admin-login-form"); await t.expect(loginForm.exists).ok(); await doLogin(t); - await t.expect(await getPageUrl() === "/admin/events").ok(); + await t.expect(await getPageUrl()).contains("/admin/events"); const newButton = Selector("[data-e2e=\"create-event\"]"); await t.click(newButton); - // await t.expect(await getPageUrl() === "/admin/events/create").ok(); - console.log(await getPageUrl()); + await t.expect(await getPageUrl()).contains("/admin/events/create"); const titleFi = Selector("#rjsf_title_fi"); const titleEn = Selector("#rjsf_title_en"); diff --git a/tests/testcafe/admin/create-signup.test.ts b/tests/testcafe/admin/create-signup.test.ts index 0276c42..18167cf 100644 --- a/tests/testcafe/admin/create-signup.test.ts +++ b/tests/testcafe/admin/create-signup.test.ts @@ -14,12 +14,11 @@ test("Logged in user can create signup", async t => { const loginForm = Selector("form.admin-login-form"); await t.expect(loginForm.exists).ok(); await doLogin(t); - await t.expect(await getPageUrl() === "/admin/signups").ok(); + await t.expect(await getPageUrl()).contains("/admin/signups"); const newButton = Selector("[data-e2e=\"create-signup\"]"); await t.click(newButton); - // await t.expect(await getPageUrl() === "/admin/signups/create").ok(); - console.log(await getPageUrl()); + await t.expect(await getPageUrl()).contains("/admin/signups/create"); const titleFi = Selector("#rjsf_title_fi"); const titleEn = Selector("#rjsf_title_en"); diff --git a/tests/testcafe/admin/login.test.ts b/tests/testcafe/admin/login.test.ts index 3672cc3..a58dfd4 100644 --- a/tests/testcafe/admin/login.test.ts +++ b/tests/testcafe/admin/login.test.ts @@ -27,7 +27,7 @@ test("User can log out and is redirected to login", async t => { */ await t.click(Selector("#login-submit")); - const logout = Selector(`[data-e2e="admin-sidebar-logout"]`); + const logout = Selector("[data-e2e=\"admin-sidebar-logout\"]"); await t.click(logout); const loginForm = Selector("form.admin-login-form"); diff --git a/tests/testcafe/signupToEvent.test.ts b/tests/testcafe/signupToEvent.test.ts index d4b5a75..dd690be 100644 --- a/tests/testcafe/signupToEvent.test.ts +++ b/tests/testcafe/signupToEvent.test.ts @@ -21,15 +21,13 @@ test("User signups to event from front page", async t => { await t .click(CardSelector.child("a")); - let url = await getPageUrl(); - await t.expect(url).match(/\/events\/\d{1,4}/, "URL isn't /events/"); + await t.expect(await getPageUrl()).match(/\/events\/\d{1,4}/, "URL isn't /events/"); const SignupButton = Selector("button"); await t .click(SignupButton); - url = await getPageUrl(); - await t.expect(url).match(/\/signup\/\d{1,4}/, "URL isn't /signup/"); + await t.expect(await getPageUrl()).match(/\/signup\/\d{1,4}/, "URL isn't /signup/"); const nameField = Selector("input").nth(0); const emailField = Selector("input").nth(1);