Skip to content

Commit

Permalink
fixup! feat: added file action to Files to import file into Tables
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusknorr committed Mar 6, 2024
1 parent 94f1ad9 commit ac213d4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cypress/e2e/tables-import.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ describe('Import csv', () => {
before(function() {
cy.createRandomUser().then(user => {
localUser = user
cy.login(localUser)
cy.uploadFile('test-import.csv', 'text/csv')
})
})

Expand All @@ -14,7 +16,6 @@ describe('Import csv', () => {
})

it('Import csv from Files', () => {
cy.uploadFile('test-import.csv', 'text/csv')
cy.loadTable('Tutorial')
cy.clickOnTableThreeDotMenu('Import')
cy.get('.modal__content button').contains('Select from Files').click()
Expand Down Expand Up @@ -53,19 +54,18 @@ describe('Import csv from Files file action', () => {
before(function() {
cy.createRandomUser().then(user => {
localUser = user
cy.login(localUser)
cy.uploadFile('test-import.csv', 'text/csv')
})
})

beforeEach(function() {
cy.login(localUser)
cy.visit('apps/files/files')
cy.uploadFile('test-import.csv', 'text/csv')
})

it('Import to new table', () => {
cy.reload()

cy.get('[data-cy-files-list-row-actions] .action-item button').click()
cy.get('[data-cy-files-list-row-name="test-import.csv"] [data-cy-files-list-row-actions] .action-item button').click()
cy.get('[data-cy-files-list-row-action="import-to-tables"]').click()

cy.intercept({ method: 'POST', url: '**/apps/tables/import/table/*'}).as('importNewTableReq')
Expand All @@ -81,7 +81,7 @@ describe('Import csv from Files file action', () => {
})

it('Import to existing table', () => {
cy.get('[data-cy-files-list-row-actions] .action-item button').click()
cy.get('[data-cy-files-list-row-name="test-import.csv"] [data-cy-files-list-row-actions] .action-item button').click()
cy.get('[data-cy-files-list-row-action="import-to-tables"]').click()

cy.get('[data-cy="importAsNewTableSwitch"]').click()
Expand Down

0 comments on commit ac213d4

Please sign in to comment.