2
0

🧪 Add delete tests on dashboard

This commit is contained in:
Baptiste Arnaud
2022-01-03 17:47:28 +01:00
parent 6322402c96
commit 6db34a8d4f
2 changed files with 23 additions and 3 deletions

View File

@@ -90,7 +90,12 @@ export const TypebotButton = ({
{...listeners} {...listeners}
{...attributes} {...attributes}
> >
<MoreButton pos="absolute" top="10px" right="10px"> <MoreButton
pos="absolute"
top="10px"
right="10px"
aria-label="Show typebot menu"
>
<MenuItem onClick={handleDuplicateClick}>Duplicate</MenuItem> <MenuItem onClick={handleDuplicateClick}>Duplicate</MenuItem>
<MenuItem <MenuItem
color="red" color="red"

View File

@@ -4,7 +4,7 @@ describe('Dashboard page', () => {
cy.signOut() cy.signOut()
}) })
test('folders navigation should work', () => { it('folders navigation should work', () => {
cy.signIn('test1@gmail.com') cy.signIn('test1@gmail.com')
cy.visit('/typebots') cy.visit('/typebots')
createFolder('My folder #1') createFolder('My folder #1')
@@ -26,7 +26,22 @@ describe('Dashboard page', () => {
cy.findByDisplayValue('My folder #2').should('not.exist') 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.signIn('test2@gmail.com')
cy.visit('/typebots') cy.visit('/typebots')
cy.findByTestId('typebot-button-typebot1').mouseMoveBy(-100, 0, { cy.findByTestId('typebot-button-typebot1').mouseMoveBy(-100, 0, {