mirror of
https://github.com/enso-org/enso.git
synced 2024-12-22 04:01:37 +03:00
5ed5c71e93
#### Tl;dr Closes: enso-org/cloud-v2#1228 This PR adds a new DIalog that requires user to submit terms and conditions ![CleanShot 2024-05-16 at 16 44 52@2x](https://github.com/enso-org/enso/assets/61194245/02814557-e7b3-4e4a-9148-2f8be52c0858) <details><summary>Demo Presentation</summary> <p>
40 lines
1.2 KiB
TypeScript
40 lines
1.2 KiB
TypeScript
/** @file Test the login flow. */
|
|
import * as test from '@playwright/test'
|
|
|
|
import * as actions from './actions'
|
|
|
|
// =============
|
|
// === Tests ===
|
|
// =============
|
|
|
|
test.test('sign up without organization id', async ({ page }) => {
|
|
await page.goto('/')
|
|
await page.waitForLoadState('domcontentloaded')
|
|
await page.goto('/registration')
|
|
const api = await actions.mockApi({ page })
|
|
api.setCurrentUser(null)
|
|
|
|
// Sign up
|
|
await actions.locateEmailInput(page).fill(actions.VALID_EMAIL)
|
|
await actions.locatePasswordInput(page).fill(actions.VALID_PASSWORD)
|
|
await actions.locateConfirmPasswordInput(page).fill(actions.VALID_PASSWORD)
|
|
await actions.locateRegisterButton(page).click()
|
|
|
|
await actions.passTermsAndConditionsDialog({ page })
|
|
|
|
// Log in
|
|
await actions.locateEmailInput(page).fill(actions.VALID_EMAIL)
|
|
await actions.locatePasswordInput(page).fill(actions.VALID_PASSWORD)
|
|
await actions.locateLoginButton(page).click()
|
|
|
|
await actions.passTermsAndConditionsDialog({ page })
|
|
|
|
// Set username
|
|
await actions.locateUsernameInput(page).fill('arbitrary username')
|
|
await actions.locateSetUsernameButton(page).click()
|
|
|
|
test
|
|
.expect(api.currentUser?.organizationId, 'new user has correct organization id')
|
|
.toBe(api.defaultOrganizationId)
|
|
})
|