Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cypress test: delete table with view #899

Merged
merged 1 commit into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading