From 43b056f41249f232feaf9d11bb1961a877563f30 Mon Sep 17 00:00:00 2001 From: br0kenpixel <23280129+br0kenpixel@users.noreply.github.com> Date: Thu, 4 Dec 2025 12:46:10 +0100 Subject: [PATCH] fix: broken cypress tests due to new internship list view --- .../app/components/InternshipListView.vue | 4 ++-- .../e2e/admin/internships/downloads.cy.ts | 4 ++-- .../cypress/e2e/admin/internships/list.cy.ts | 22 +++++-------------- 3 files changed, 9 insertions(+), 21 deletions(-) diff --git a/frontend/app/components/InternshipListView.vue b/frontend/app/components/InternshipListView.vue index 0360206..a83d142 100644 --- a/frontend/app/components/InternshipListView.vue +++ b/frontend/app/components/InternshipListView.vue @@ -136,13 +136,13 @@ async function confirmDeletion(confirm: boolean) { diff --git a/frontend/cypress/e2e/admin/internships/downloads.cy.ts b/frontend/cypress/e2e/admin/internships/downloads.cy.ts index 71ecf09..23c0a46 100644 --- a/frontend/cypress/e2e/admin/internships/downloads.cy.ts +++ b/frontend/cypress/e2e/admin/internships/downloads.cy.ts @@ -12,6 +12,7 @@ describe('Admin Student Document Downloads', () => { cy.contains("Praxe").click() cy.url().should('include', '/dashboard/admin/internships') + cy.wait(2000) }) it('should be able to generate and download the default proof', () => { @@ -24,13 +25,12 @@ describe('Admin Student Document Downloads', () => { }) cy.get('@randomRow').within(() => { - cy.get('td').contains('Editovať').click() + cy.get('td').get('.internship-edit-btn').click() }) }) cy.url().should('include', '/dashboard/admin/internships/edit/') - const downloadsFolder = Cypress.config("downloadsFolder"); cy.contains('Stiahnuť originálnu zmluvu').click() cy.wait(2000) }) diff --git a/frontend/cypress/e2e/admin/internships/list.cy.ts b/frontend/cypress/e2e/admin/internships/list.cy.ts index 50b7ec0..5a4f1e2 100644 --- a/frontend/cypress/e2e/admin/internships/list.cy.ts +++ b/frontend/cypress/e2e/admin/internships/list.cy.ts @@ -12,6 +12,7 @@ describe('Admin Internship CRUD', () => { cy.contains("Praxe").click() cy.url().should('include', '/dashboard/admin/internships') + cy.wait(2000) }) it('should load the list of internships in a proper format', () => { @@ -64,28 +65,15 @@ describe('Admin Internship CRUD', () => { }) }) - // Ešte nie je implementované mazanie - /*it('should be able to delete an internship', () => { - let initialRowCount = 0 - - cy.get('table tbody tr').its('length').then((count) => { - initialRowCount = count - }) - + it('should be able to delete an internship', () => { cy.get('table tbody tr').first().within(() => { - cy.contains('Vymazať').click() + cy.get('.internship-delete-btn').click() }) cy.contains("Potvrdiť vymazanie").parent().should('be.visible') - cy.contains("Potvrdiť vymazanie").parent().contains("Vymazať").click() + cy.contains("Potvrdiť vymazanie").parent().contains("Áno").click() cy.contains("Potvrdiť vymazanie").should('not.exist') cy.wait(1000) - - cy.get('table tbody tr').its('length').then((count) => { - expect(count).to.be.eq(initialRowCount - 1) - }) - })*/ - - // TODO: Edit praxe + }) }) \ No newline at end of file