mirror of
https://github.com/enso-org/enso.git
synced 2024-12-23 00:01:35 +03:00
b83c5a15eb
- Close https://github.com/enso-org/cloud-v2/issues/1604 - Add ability to track backend calls - Remove inconsistent integration test code - Add skeleton classes for settings pages # Important Notes None
38 lines
1.5 KiB
TypeScript
38 lines
1.5 KiB
TypeScript
/** @file Actions for the "account" tab of the "settings" page. */
|
|
import BaseSettingsTabActions from './BaseSettingsTabActions'
|
|
import SettingsAccountFormActions from './SettingsAccountFormActions'
|
|
import SettingsChangePasswordFormActions from './SettingsChangePasswordFormActions'
|
|
import { goToSettingsTabActions, type GoToSettingsTabActions } from './gotoSettingsTabActions'
|
|
|
|
/** Actions for the "account" tab of the "settings" page. */
|
|
export default class SettingsAccountTabActions<Context> extends BaseSettingsTabActions<Context> {
|
|
/** Actions for navigating to another settings tab. */
|
|
get goToSettingsTab(): Omit<GoToSettingsTabActions<Context>, 'account'> {
|
|
return goToSettingsTabActions(this.step.bind(this))
|
|
}
|
|
|
|
/** Manipulate the "account" form. */
|
|
accountForm() {
|
|
return this.into(SettingsAccountFormActions<Context>)
|
|
}
|
|
|
|
/** Manipulate the "change password" form. */
|
|
changePasswordForm() {
|
|
return this.into(SettingsChangePasswordFormActions<Context>)
|
|
}
|
|
|
|
/** Upload a profile picture. */
|
|
uploadProfilePicture(
|
|
name: string,
|
|
content: WithImplicitCoercion<string | Uint8Array | readonly number[]>,
|
|
mimeType: string,
|
|
) {
|
|
return this.step('Upload account profile picture', async (page) => {
|
|
const fileChooserPromise = page.waitForEvent('filechooser')
|
|
await page.getByTestId('user-profile-picture-input').click()
|
|
const fileChooser = await fileChooserPromise
|
|
await fileChooser.setFiles([{ name, mimeType, buffer: Buffer.from(content) }])
|
|
})
|
|
}
|
|
}
|