aboutsummaryrefslogtreecommitdiffstats
path: root/cypress
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2025-02-05 23:48:15 +0100
committerFerdinand Thiessen <opensource@fthiessen.de>2025-02-06 11:58:24 +0100
commit460ceaac57343fcb6889a26c3d8fb94ee41a5d81 (patch)
treebfd61083b61a0831b42e2cc842947ee11a0d3060 /cypress
parent2a0f81da53149ebd57f14cf1d697aded1481ef24 (diff)
downloadnextcloud-server-460ceaac57343fcb6889a26c3d8fb94ee41a5d81.tar.gz
nextcloud-server-460ceaac57343fcb6889a26c3d8fb94ee41a5d81.zip
fix(settings): Also sanitize fediverse and twitter handle in the frontend
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'cypress')
-rw-r--r--cypress/e2e/settings/personal-info.cy.ts19
1 files changed, 13 insertions, 6 deletions
diff --git a/cypress/e2e/settings/personal-info.cy.ts b/cypress/e2e/settings/personal-info.cy.ts
index 940e3cd6449..80d2c87fe40 100644
--- a/cypress/e2e/settings/personal-info.cy.ts
+++ b/cypress/e2e/settings/personal-info.cy.ts
@@ -98,13 +98,19 @@ const checkSettingsVisibility = (property: string, defaultVisibility: Visibility
}) */
}
-const genericProperties = ['Location', 'X (formerly Twitter)', 'Fediverse']
+const genericProperties = [
+ ['Location', 'Berlin'],
+ ['X (formerly Twitter)', 'nextclouders'],
+ ['Fediverse', 'nextcloud@mastodon.xyz'],
+]
const nonfederatedProperties = ['Organisation', 'Role', 'Headline', 'About']
describe('Settings: Change personal information', { testIsolation: true }, () => {
let snapshot: string = ''
before(() => {
+ // make sure the fediverse check does not do http requests
+ cy.runOccCommand('config:system:set has_internet_connection --value false')
// ensure we can set locale and language
cy.runOccCommand('config:system:delete force_language')
cy.runOccCommand('config:system:delete force_locale')
@@ -125,6 +131,8 @@ describe('Settings: Change personal information', { testIsolation: true }, () =>
})
after(() => {
+ cy.runOccCommand('config:system:delete has_internet_connection')
+
cy.runOccCommand('config:system:set force_language --value en')
cy.runOccCommand('config:system:set force_locale --value en_US')
})
@@ -349,22 +357,21 @@ describe('Settings: Change personal information', { testIsolation: true }, () =>
})
// Check generic properties that allow any visibility and any value
- genericProperties.forEach((property) => {
+ genericProperties.forEach(([property, value]) => {
it(`Can set ${property} and change its visibility`, () => {
- const uniqueValue = `${property.toUpperCase()} ${property.toLowerCase()}`
cy.contains('label', property).scrollIntoView()
- inputForLabel(property).type(uniqueValue)
+ inputForLabel(property).type(value)
handlePasswordConfirmation(user.password)
cy.wait('@submitSetting')
cy.reload()
- inputForLabel(property).should('have.value', uniqueValue)
+ inputForLabel(property).should('have.value', value)
checkSettingsVisibility(property)
// check it is visible on the profile
cy.visit(`/u/${user.userId}`)
- cy.contains(uniqueValue).should('be.visible')
+ cy.contains(value).should('be.visible')
})
})