aboutsummaryrefslogtreecommitdiffstats
path: root/cypress
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2023-10-21 00:34:27 +0200
committerFerdinand Thiessen <opensource@fthiessen.de>2023-10-21 03:52:18 +0200
commit9697df1ea5782fce0752bcebfa3318c05cc0ed1f (patch)
treedc76a50646fbf944696f7f9fc4d570444f2defe4 /cypress
parent5c2610af7dbce72fa1c1b02185a2c28cd5be004e (diff)
downloadnextcloud-server-9697df1ea5782fce0752bcebfa3318c05cc0ed1f.tar.gz
nextcloud-server-9697df1ea5782fce0752bcebfa3318c05cc0ed1f.zip
fix(theming): App order settings - ensure the focus is kept on button
When pressing a button for changing the app order that button should keep the focus after reordering the list. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'cypress')
-rw-r--r--cypress/e2e/theming/navigation-bar-settings.cy.ts41
1 files changed, 41 insertions, 0 deletions
diff --git a/cypress/e2e/theming/navigation-bar-settings.cy.ts b/cypress/e2e/theming/navigation-bar-settings.cy.ts
index 50c48d5ac6d..a5657ee5a15 100644
--- a/cypress/e2e/theming/navigation-bar-settings.cy.ts
+++ b/cypress/e2e/theming/navigation-bar-settings.cy.ts
@@ -210,3 +210,44 @@ describe('User theming set app order with default app', () => {
})
})
})
+
+describe('User theming app order list accessibility', () => {
+ let user: User
+
+ before(() => {
+ cy.resetAdminTheming()
+ // Create random user for this test
+ cy.createRandomUser().then(($user) => {
+ user = $user
+ cy.login($user)
+ })
+ })
+
+ after(() => {
+ cy.deleteUser(user)
+ })
+
+ it('See the app order settings', () => {
+ cy.visit('/settings/user/theming')
+ cy.get('[data-cy-app-order]').scrollIntoView()
+ cy.get('[data-cy-app-order] [data-cy-app-order-element]').should('have.length', 2)
+ })
+
+ it('click the first button', () => {
+ cy.get('[data-cy-app-order] [data-cy-app-order-element]:first-of-type [data-cy-app-order-button="down"]').should('be.visible').click()
+ })
+
+ it('see the same app kept the focus', () => {
+ cy.get('[data-cy-app-order] [data-cy-app-order-element]:first-of-type [data-cy-app-order-button="down"]').should('not.have.focus')
+ cy.get('[data-cy-app-order] [data-cy-app-order-element]:last-of-type [data-cy-app-order-button="up"]').should('have.focus')
+ })
+
+ it('click the last button', () => {
+ cy.get('[data-cy-app-order] [data-cy-app-order-element]:last-of-type [data-cy-app-order-button="up"]').should('be.visible').click()
+ })
+
+ it('see the same app kept the focus', () => {
+ cy.get('[data-cy-app-order] [data-cy-app-order-element]:first-of-type [data-cy-app-order-button="down"]').should('have.focus')
+ cy.get('[data-cy-app-order] [data-cy-app-order-element]:last-of-type [data-cy-app-order-button="up"]').should('not.have.focus')
+ })
+})