Skip to content

Commit

Permalink
test: delete table with view
Browse files Browse the repository at this point in the history
Signed-off-by: Cleopatra Enjeck M <patrathewhiz@gmail.com>
  • Loading branch information
enjeck committed Mar 3, 2024
1 parent b0e1534 commit b920bca
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
14 changes: 14 additions & 0 deletions cypress/e2e/view.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,20 @@ describe('Interact with views', () => {
cy.get('[data-cy="viewSettingsDialogSection"] input').type(title)
})

// cleanup
afterEach(function() {
// delete table (with view)
cy.get('[data-cy="navigationTableItem"]').contains('View test table').click({ force: true })
cy.get('[data-cy="customTableAction"] button').click()
cy.get('[data-cy="dataTableEditTableBtn"]').contains('Edit table').click()
cy.get('[data-cy="editTableModal"]').should('be.visible')
cy.get('[data-cy="editTableModal"] button').contains('Delete').click()
cy.get('[data-cy="editTableModal"] button').contains('I really want to delete this table!').click()
cy.wait(10).get('.toastify.toast-success').should('be.visible')
cy.get('[data-cy="navigationTableItem"]').contains('View test table').should('not.exist')
cy.get('[data-cy="navigationTableItem"]').contains(title).should('not.exist')
})

it('Create view and insert rows in the view', () => {
// ## add filter
cy.get('[data-cy="filterFormFilterGroupBtn"]').contains('Add new filter group').click()
Expand Down
3 changes: 2 additions & 1 deletion src/modules/main/sections/DataTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@
<template #actions>
<NcActions :force-menu="true" :type="isViewSettingSet ? 'secondary' : 'tertiary'">
<NcActionCaption v-if="canManageElement(table)" :name="t('tables', 'Manage table')" />
<NcActionButton v-if="canManageElement(table) "
<NcActionButton v-if="canManageElement(table)"
data-cy="dataTableEditTableBtn"
:close-after-click="true"
@click="emit('tables:table:edit', table.id)">
<template #icon>
Expand Down

0 comments on commit b920bca

Please sign in to comment.