Skip to content

Commit

Permalink
🧪 Add delete tests on dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed Jan 3, 2022
1 parent 6322402 commit 6db34a8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,12 @@ export const TypebotButton = ({
{...listeners}
{...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
color="red"
Expand Down
19 changes: 17 additions & 2 deletions apps/builder/cypress/tests/dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ describe('Dashboard page', () => {
cy.signOut()
})

test('folders navigation should work', () => {
it('folders navigation should work', () => {
cy.signIn('test1@gmail.com')
cy.visit('/typebots')
createFolder('My folder #1')
Expand All @@ -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, {
Expand Down

0 comments on commit 6db34a8

Please sign in to comment.