From 6db34a8d4f3b8b7ef736b3ea355223c1305952d2 Mon Sep 17 00:00:00 2001 From: Baptiste Arnaud Date: Mon, 3 Jan 2022 17:47:28 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=AA=20Add=20delete=20tests=20on=20dash?= =?UTF-8?q?board?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dashboard/FolderContent/TypebotButton.tsx | 7 ++++++- apps/builder/cypress/tests/dashboard.ts | 19 +++++++++++++++++-- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/apps/builder/components/dashboard/FolderContent/TypebotButton.tsx b/apps/builder/components/dashboard/FolderContent/TypebotButton.tsx index 3ae72a082c..14da6bcca2 100644 --- a/apps/builder/components/dashboard/FolderContent/TypebotButton.tsx +++ b/apps/builder/components/dashboard/FolderContent/TypebotButton.tsx @@ -90,7 +90,12 @@ export const TypebotButton = ({ {...listeners} {...attributes} > - + Duplicate { cy.signOut() }) - test('folders navigation should work', () => { + it('folders navigation should work', () => { cy.signIn('test1@gmail.com') cy.visit('/typebots') createFolder('My folder #1') @@ -26,7 +26,22 @@ describe('Dashboard page', () => { cy.findByDisplayValue('My folder #2').should('not.exist') }) - test('folders should be draggable and droppable', () => { + it('folders and typebots should be deletable', () => { + cy.signIn('test2@gmail.com') + cy.visit('/typebots') + cy.findByText('Folder #1').should('exist') + cy.findAllByRole('button', { name: 'Show folder menu' }).first().click() + cy.findByRole('menuitem', { name: 'Delete' }).click() + cy.findByRole('button', { name: 'Delete' }).click() + cy.findByText('Folder #1').should('not.exist') + cy.findByText('Typebot #1').should('exist') + cy.findAllByRole('button', { name: 'Show typebot menu' }).first().click() + cy.findByRole('menuitem', { name: 'Delete' }).click() + cy.findByRole('button', { name: 'Delete' }).click() + cy.findByText('Typebot #1').should('not.exist') + }) + + it('folders should be draggable and droppable', () => { cy.signIn('test2@gmail.com') cy.visit('/typebots') cy.findByTestId('typebot-button-typebot1').mouseMoveBy(-100, 0, {