diff --git a/cypress/e2e/tables-table.cy.js b/cypress/e2e/tables-table.cy.js index ce9ab1bb6..fc4d6e54f 100644 --- a/cypress/e2e/tables-table.cy.js +++ b/cypress/e2e/tables-table.cy.js @@ -24,7 +24,7 @@ describe('Manage a table', () => { cy.get('.modal__content').should('be.visible') cy.get('.modal__content input[type="text"]').clear().type('to do list') cy.get('.modal__content #description-editor .tiptap.ProseMirror').type('to Do List description') - cy.contains('button', 'Create table').click() + cy.contains('button', 'Create table').scrollIntoView().click() cy.contains('button', 'Create row').should('be.visible') cy.contains('h1', 'to do list').should('be.visible') @@ -32,6 +32,28 @@ describe('Manage a table', () => { cy.contains('.paragraph-content', 'to Do List description').should('be.visible') }) + it('Create with import', () => { + cy.uploadFile('test-import.csv', 'text/csv') + cy.contains('.app-menu-entry--label', 'Tables').click() + cy.contains('button', 'Create new table').click() + cy.get('.tile').contains('Import').click({ force: true }) + cy.get('.modal__content').should('be.visible') + cy.get('.modal__content input[type="text"]').clear().type('import list') + cy.contains('button', 'Create table').scrollIntoView().click() + cy.contains('h2', 'Import').should('be.visible') + + cy.get('.modal__content button').contains('Select from Files').click() + cy.get('.file-picker__files').contains('test-import').click() + cy.get('.file-picker button span').contains('Choose test-import.csv').click() + cy.get('.modal__content button').contains('Import').click() + cy.get('[data-cy="importResultColumnsFound"]').should('contain.text', '4') + cy.get('[data-cy="importResultColumnsMatch"]').should('contain.text', '0') + cy.get('[data-cy="importResultColumnsCreated"]').should('contain.text', '4') + cy.get('[data-cy="importResultRowsInserted"]').should('contain.text', '3') + cy.get('[data-cy="importResultParsingErrors"]').should('contain.text', '0') + cy.get('[data-cy="importResultRowErrors"]').should('contain.text', '0') + }) + it('Update title And Description', () => { cy.get('.app-navigation__list').contains('to do list').click({ force: true }) cy.get('[data-cy="customTableAction"] button').click() diff --git a/src/modules/modals/CreateTable.vue b/src/modules/modals/CreateTable.vue index 1dcd7801c..cfd18fce5 100644 --- a/src/modules/modals/CreateTable.vue +++ b/src/modules/modals/CreateTable.vue @@ -45,6 +45,14 @@ :tabbable="true" @set-template="setTemplate('custom')" /> +