-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(settings): Also sanitize fediverse and twitter handle in the fron…
…tend Signed-off-by: Ferdinand Thiessen <[email protected]>
- Loading branch information
Showing
7 changed files
with
82 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -115,18 +115,26 @@ const checkSettingsVisibility = (property: string, defaultVisibility: Visibility | |
}) */ | ||
} | ||
|
||
const genericProperties = ['Location', 'X (formerly Twitter)', 'Fediverse'] | ||
const genericProperties = [ | ||
['Location', 'Berlin'], | ||
['X (formerly Twitter)', 'nextclouders'], | ||
['Fediverse', '[email protected]'], | ||
] | ||
const nonfederatedProperties = ['Organisation', 'Role', 'Headline', 'About'] | ||
|
||
describe('Settings: Change personal information', { testIsolation: true }, () => { | ||
|
||
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') | ||
}) | ||
|
||
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') | ||
}) | ||
|
@@ -350,22 +358,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') | ||
}) | ||
}) | ||
|
||
|