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

chore/bump libraries #1187

Closed
wants to merge 6 commits into from
Closed
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
8 changes: 2 additions & 6 deletions cypress/e2e/column-datetime.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ describe('Test column ' + columnTitle, () => {
cy.createRandomUser().then(user => {
localUser = user
cy.login(localUser)
cy.visit('apps/tables')
cy.createTable(tableTitle)
})
})

Expand All @@ -16,18 +18,13 @@ describe('Test column ' + columnTitle, () => {
cy.visit('apps/tables')
})

it('Table and column setup', () => {
cy.createTable(tableTitle)
})

it('Insert and test rows', () => {
cy.loadTable(tableTitle)
cy.createDatetimeColumn(columnTitle, null, true)

// insert row with int value
cy.get('button').contains('Create row').click()
cy.get('.modal__content input').first().clear().type('2023-12-24T05:15')
cy.get('[data-cy="createRowAddMoreSwitch"]').click().click()
cy.get('button').contains('Save').click()
cy.get('.custom-table table tr td div').contains('24').should('be.visible')
cy.get('.custom-table table tr td div').contains('Dec').should('be.visible')
Expand All @@ -50,7 +47,6 @@ describe('Test column ' + columnTitle, () => {

cy.get('button').contains('Create row').click()
cy.get('.modal__content input').first().should('contain.value', '2023-12-24T07:21')
cy.get('[data-cy="createRowAddMoreSwitch"]').click().click()
cy.get('button').contains('Save').click()
cy.get('.custom-table table tr td div').contains('7:').should('be.visible')
cy.get('.custom-table table tr td div').contains('Dec').should('be.visible')
Expand Down
8 changes: 2 additions & 6 deletions cypress/e2e/column-datetimeDate.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ describe('Test column ' + columnTitle, () => {
cy.createRandomUser().then(user => {
localUser = user
cy.login(localUser)
cy.visit('apps/tables')
cy.createTable(tableTitle)
})
})

Expand All @@ -16,18 +18,13 @@ describe('Test column ' + columnTitle, () => {
cy.visit('apps/tables')
})

it('Table and column setup', () => {
cy.createTable(tableTitle)
})

it('Insert and test rows', () => {
cy.loadTable(tableTitle)
cy.createDatetimeDateColumn(columnTitle, null, true)

// insert row with int value
cy.get('button').contains('Create row').click()
cy.get('.modal__content input').first().clear().type('2023-12-24')
cy.get('[data-cy="createRowAddMoreSwitch"]').click().click()
cy.get('button').contains('Save').click()
cy.get('.custom-table table tr td div').contains('24').should('be.visible')
cy.get('.custom-table table tr td div').contains('Dec').should('be.visible')
Expand All @@ -49,7 +46,6 @@ describe('Test column ' + columnTitle, () => {
cy.get('button').contains('Create row').click()
const date = new Date().toISOString().slice(2, 10)
cy.get('.modal__content input').first().should('contain.value', date)
cy.get('[data-cy="createRowAddMoreSwitch"]').click().click()
cy.get('button').contains('Save').click()
const monthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
const datetime2 = new Date().getDate() + ' ' + monthNames[new Date().getMonth()] + ' ' + new Date().getFullYear()
Expand Down
8 changes: 2 additions & 6 deletions cypress/e2e/column-datetimeTime.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ describe('Test column ' + columnTitle, () => {
cy.createRandomUser().then(user => {
localUser = user
cy.login(localUser)
cy.visit('apps/tables')
cy.createTable(tableTitle)
})
})

Expand All @@ -16,18 +18,13 @@ describe('Test column ' + columnTitle, () => {
cy.visit('apps/tables')
})

it('Table and column setup', () => {
cy.createTable(tableTitle)
})

it('Insert and test rows', () => {
cy.loadTable(tableTitle)
cy.createDatetimeTimeColumn(columnTitle, null, true)

// insert row with int value
cy.get('button').contains('Create row').click()
cy.get('.modal__content input').first().clear().type('05:15')
cy.get('[data-cy="createRowAddMoreSwitch"]').click().click()
cy.get('button').contains('Save').click()
cy.get('.custom-table table tr td div').contains('5:15').should('be.visible')

Expand All @@ -48,7 +45,6 @@ describe('Test column ' + columnTitle, () => {
// insert row with int value
cy.get('button').contains('Create row').click()
cy.get('.modal__content input').first().should('contain.value', '07:21')
cy.get('[data-cy="createRowAddMoreSwitch"]').click().click()
cy.get('button').contains('Save').click()
cy.get('.custom-table table tr td div').contains('7:21').should('be.visible')
})
Expand Down
6 changes: 2 additions & 4 deletions cypress/e2e/column-number-progress.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ describe('Test column progress', () => {
cy.createRandomUser().then(user => {
localUser = user
cy.login(localUser)
cy.visit('apps/tables')
cy.createTable(tableTitle)
})
})

Expand All @@ -16,10 +18,6 @@ describe('Test column progress', () => {
cy.visit('apps/tables')
})

it('Table and column setup', () => {
cy.createTable(tableTitle)
})

it('Insert and test rows - default values', () => {
cy.loadTable(tableTitle)
cy.createNumberProgressColumn(columnTitle, 23, true)
Expand Down
10 changes: 4 additions & 6 deletions cypress/e2e/column-selection-check.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ describe('Test column ' + columnTitle, () => {
cy.createRandomUser().then(user => {
localUser = user
cy.login(localUser)
cy.visit('apps/tables')
cy.createTable(tableTitle)
})
})

Expand All @@ -16,10 +18,6 @@ describe('Test column ' + columnTitle, () => {
cy.visit('apps/tables')
})

it('Table and column setup', () => {
cy.createTable(tableTitle)
})

it('Insert and test rows - default value unchecked', () => {
cy.loadTable(tableTitle)
cy.createSelectionCheckColumn(columnTitle, null, true)
Expand All @@ -31,7 +29,7 @@ describe('Test column ' + columnTitle, () => {

// insert row
cy.get('button').contains('Create row').click()
cy.get('[data-cy="selectionCheckFormSwitch"]').first().click()
cy.get('[data-cy="selectionCheckFormSwitch"]').first().find('input').click({ force: true })
cy.get('button').contains('Save').click()
cy.get('.custom-table table tr td div .material-design-icon.check-circle-outline-icon').should('be.visible')

Expand All @@ -49,7 +47,7 @@ describe('Test column ' + columnTitle, () => {

// insert row
cy.get('button').contains('Create row').click()
cy.get('[data-cy="selectionCheckFormSwitch"]').first().click()
cy.get('[data-cy="selectionCheckFormSwitch"]').first().find('input').click({ force: true })
cy.get('button').contains('Save').click()
cy.get('.custom-table table tr td div .material-design-icon.radiobox-blank-icon').should('be.visible')

Expand Down
27 changes: 14 additions & 13 deletions cypress/e2e/tables-favorite.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('Favorite tables/views', () => {
})

it('can favorite tables', () => {
cy.get('[data-cy="navigationTableItem"]').first().as('tutorialTable')
cy.get('[data-cy="navigationTableItem"] .app-navigation-entry').first().as('tutorialTable')

cy.get('@tutorialTable').should('contain.text', 'Tutorial')
cy.get('@tutorialTable').find('[aria-haspopup="menu"]').click({ force: true })
Expand All @@ -24,11 +24,11 @@ describe('Favorite tables/views', () => {
cy.contains('Add to favorites').click({ force: true })
cy.wait('@favoriteTableReq').its('response.statusCode').should('equal', 200)

cy.get('@tutorialTable').parent().should('contain.text', 'Favorites')
cy.get('@tutorialTable').parent().prev().should('contain.text', 'Favorites')
})

it('can remove favorite table', () => {
cy.get('[data-cy="navigationTableItem"]').first().as('tutorialTable')
cy.get('[data-cy="navigationTableItem"] .app-navigation-entry').first().as('tutorialTable')

cy.get('@tutorialTable').should('contain.text', 'Tutorial')
cy.get('@tutorialTable').find('[aria-haspopup="menu"]').click({ force: true })
Expand All @@ -37,54 +37,55 @@ describe('Favorite tables/views', () => {
cy.contains('Remove from favorites').click({ force: true })
cy.wait('@unfavoriteTableReq').its('response.statusCode').should('equal', 200)

cy.get('@tutorialTable').parent().should('contain.text', 'Tables')
cy.get('@tutorialTable').parent().prev().should('contain.text', 'Tables')
})

it('can favorite views', () => {
cy.loadTable('Tutorial')
cy.createView('test')

cy.get('[data-cy="navigationViewItem"]').first().as('testView')
cy.contains('[data-cy="navigationViewItem"]', 'test').first().as('testView')

cy.get('@testView').parent().parent().should('contain.text', 'Tutorial')
cy.get('@testView').closest('[data-cy="navigationTableItem"]').should('contain.text', 'Tutorial')
cy.get('@testView').find('[aria-haspopup="menu"]').click({ force: true })

cy.intercept({ method: 'POST', url: '**/ocs/v2.php/apps/tables/api/2/favorites/*/*' }).as('favoriteViewReq')
cy.contains('Add to favorites').click({ force: true })
cy.wait('@favoriteViewReq').its('response.statusCode').should('equal', 200)

cy.get('@testView').parent().should('contain.text', 'Favorites')
cy.get('@testView').prev().should('contain.text', 'Favorites')
})

it('can unfavorite views', () => {
cy.get('[data-cy="navigationViewItem"]').first().as('testView')

cy.get('@testView').parent().should('contain.text', 'Favorites')
cy.get('@testView').prev().should('contain.text', 'Favorites')
cy.get('@testView').find('[aria-haspopup="menu"]').click({ force: true })

cy.intercept({ method: 'DELETE', url: '**/ocs/v2.php/apps/tables/api/2/favorites/*/*' }).as('unfavoriteViewReq')
cy.contains('Remove from favorites').click({ force: true })
cy.wait('@unfavoriteViewReq').its('response.statusCode').should('equal', 200)

cy.get('@testView').parent().parent().should('contain.text', 'Tutorial')
cy.get('@testView').closest('[data-cy="navigationTableItem"]').should('contain.text', 'Tutorial')
})

it('can (un)favorite views with favorited parent tables', () => {
cy.get('[data-cy="navigationTableItem"]').first().as('tutorialTable')
cy.get('@tutorialTable').find('.app-navigation-entry-link').first().click({ force: true })
cy.get('[data-cy="navigationViewItem"]').first().as('testView')
cy.get('[data-cy="navigationTableItem"]').first().as('tutorialTable')

cy.get('@testView').parent().parent().should('contain.text', 'Tutorial')
cy.get('@testView').closest('[data-cy="navigationTableItem"]').should('contain.text', 'Tutorial')
cy.get('@testView').find('[aria-haspopup="menu"]').click({ force: true })
cy.contains('Add to favorites').click({ force: true })

cy.get('@testView').parent().should('contain.text', 'Favorites')
cy.get('@testView').prev().should('contain.text', 'Favorites')

cy.get('@tutorialTable').should('contain.text', 'Tutorial')
cy.get('@tutorialTable').find('[aria-haspopup="menu"]').first().click({ force: true })
cy.contains('Add to favorites').click({ force: true })

cy.get('@tutorialTable').parent().should('contain.text', 'Tables')
cy.get('@testView').parent().should('not.contain.text', 'Favorites')
cy.get('@testView').closest('[data-cy="navigationTableItem"]').should('contain.text', 'Tutorial')
})

})
7 changes: 3 additions & 4 deletions cypress/e2e/tables-import.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('Import csv', () => {
cy.clickOnTableThreeDotMenu('Import')
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('.file-picker button span').contains('Import').click()
cy.get('.modal__content .import-filename', { timeout: 5000 }).should('be.visible')
cy.intercept({ method: 'POST', url: '**/apps/tables/import/table/*'}).as('importUploadReq')
cy.get('.modal__content button').contains('Import').click()
Expand Down Expand Up @@ -85,11 +85,11 @@ if (!['stable27'].includes(Cypress.env('ncVersion'))) {
cy.get('[data-cy="importResultRowErrors"]').should('contain.text', '0')
})

it('Import to existing table', () => {
it.only('Import to existing table', () => {
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()
cy.get('[data-cy="importAsNewTableSwitch"] input').click({ force: true })
cy.get('[data-cy="selectExistingTableDropdown"]').type('tutorial')
cy.get('.name-parts').click()

Expand All @@ -104,6 +104,5 @@ if (!['stable27'].includes(Cypress.env('ncVersion'))) {
cy.get('[data-cy="importResultParsingErrors"]').should('contain.text', '0')
cy.get('[data-cy="importResultRowErrors"]').should('contain.text', '0')
})

})
}
3 changes: 1 addition & 2 deletions cypress/e2e/tables-table.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ describe('Manage a table', () => {

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.intercept({ method: 'POST', url: '**/apps/tables/import/table/*'}).as('importUploadReq')
cy.get('.modal__content button').contains('Import').click()
cy.get('.file-picker button span').contains('Import').click()
cy.wait('@importUploadReq')
cy.get('[data-cy="importResultColumnsFound"]').should('contain.text', '4')
cy.get('[data-cy="importResultColumnsMatch"]').should('contain.text', '0')
Expand Down
Loading
Loading