From 4937127898403e38e28e825f95ce25dd71294224 Mon Sep 17 00:00:00 2001 From: Dominik Pschenitschni <6173598+dpschen@users.noreply.github.com> Date: Tue, 13 May 2025 12:51:11 +0200 Subject: [PATCH] fix: cypress selector (#753) --- frontend/cypress/e2e/project/project-view-list.spec.ts | 2 +- frontend/cypress/e2e/sharing/linkShare.spec.ts | 6 +++--- frontend/cypress/e2e/task/task.spec.ts | 4 ++-- frontend/cypress/support/authenticateUser.ts | 6 +++++- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/frontend/cypress/e2e/project/project-view-list.spec.ts b/frontend/cypress/e2e/project/project-view-list.spec.ts index 5effab8de..abe75aff2 100644 --- a/frontend/cypress/e2e/project/project-view-list.spec.ts +++ b/frontend/cypress/e2e/project/project-view-list.spec.ts @@ -68,7 +68,7 @@ describe('Project View List', () => { cy.get('.project-title-wrapper .icon') .should('not.exist') - cy.get('input.input[placeholder="Add a task..."') + cy.get('input.input[placeholder="Add a task…"]') .should('not.exist') }) diff --git a/frontend/cypress/e2e/sharing/linkShare.spec.ts b/frontend/cypress/e2e/sharing/linkShare.spec.ts index 99c74b62b..12bb9ed28 100644 --- a/frontend/cypress/e2e/sharing/linkShare.spec.ts +++ b/frontend/cypress/e2e/sharing/linkShare.spec.ts @@ -5,7 +5,7 @@ import {createProjects} from '../project/prepareProjects' function prepareLinkShare() { const projects = createProjects() const tasks = TaskFactory.create(10, { - project_id: projects[0].id + project_id: projects[0].id, }) const linkShares = LinkShareFactory.create(1, { project_id: projects[0].id, @@ -27,7 +27,7 @@ describe('Link shares', () => { cy.get('h1.title') .should('contain', project.title) - cy.get('input.input[placeholder="Add a task..."') + cy.get('input.input[placeholder="Add a task…"]') .should('not.exist') cy.get('.tasks') .should('contain', tasks[0].title) @@ -42,7 +42,7 @@ describe('Link shares', () => { cy.get('h1.title') .should('contain', project.title) - cy.get('input.input[placeholder="Add a task..."') + cy.get('input.input[placeholder="Add a task…"]') .should('not.exist') cy.get('.tasks') .should('contain', tasks[0].title) diff --git a/frontend/cypress/e2e/task/task.spec.ts b/frontend/cypress/e2e/task/task.spec.ts index 6a1530f7e..ef0f40282 100644 --- a/frontend/cypress/e2e/task/task.spec.ts +++ b/frontend/cypress/e2e/task/task.spec.ts @@ -65,7 +65,7 @@ describe('Task', () => { it('Should be created new', () => { cy.visit('/projects/1/1') - cy.get('.input[placeholder="Add a task…"') + cy.get('.input[placeholder="Add a task…"]') .type('New Task') cy.get('.button') .contains('Add') @@ -81,7 +81,7 @@ describe('Task', () => { cy.visit('/projects/1/1') cy.get('.project-is-empty-notice') .should('not.exist') - cy.get('.input[placeholder="Add a task…"') + cy.get('.input[placeholder="Add a task…"]') .type('New Task') cy.get('.button') .contains('Add') diff --git a/frontend/cypress/support/authenticateUser.ts b/frontend/cypress/support/authenticateUser.ts index 22839ae33..3d6f94073 100644 --- a/frontend/cypress/support/authenticateUser.ts +++ b/frontend/cypress/support/authenticateUser.ts @@ -21,10 +21,14 @@ export function login(user, cacheAcrossSpecs = false) { }) } +export function createFakeUser() { + return UserFactory.create(1)[0] +} + export function createFakeUserAndLogin() { let user before(() => { - user = UserFactory.create(1)[0] + user = createFakeUser() }) beforeEach(() => {