overleaf/services/web/frontend/stories/settings/helpers/password.js
Miguel Serrano 14a22de754 Merge pull request #7779 from overleaf/ta-settings-fixes-3
[SettingsPage] Small Fixes 3

GitOrigin-RevId: 98accb3c53c802e83f2939e5c25d13fcf3b5e054
2022-04-28 08:04:49 +00:00

35 lines
852 B
JavaScript

const MOCK_DELAY = 1000
export function defaultSetupMocks(fetchMock) {
fetchMock.post(
/\/user\/password\/update/,
{
status: 200,
body: {
message: {
type: 'success',
email: 'tim.alby@overleaf.com',
text: 'Password changed',
},
},
},
{
delay: MOCK_DELAY,
}
)
}
export function setDefaultMeta() {
window.metaAttributesCache = window.metaAttributesCache || new Map()
window.metaAttributesCache.set('ol-ExposedSettings', {
...window.metaAttributesCache.get('ol-ExposedSettings'),
isOverleaf: true,
})
window.metaAttributesCache.set('ol-isExternalAuthenticationSystemUsed', false)
window.metaAttributesCache.set('ol-hasPassword', true)
window.metaAttributesCache.set('ol-passwordStrengthOptions', {
length: {
min: 2,
},
})
}