enso/app/dashboard/e2e/setup.spec.ts
somebody1234 f0d02de5c8
E2E tests for setup flow (#11148)
- Add E2E tests for setup flow
- Remove `styled.Checkbox` in favor of `ariaComponents.Checkbox`
- Remove `styled.Input` in favor of `ariaComponents.Input`
- Remove `styled.Button` in favor of `ariaComponents.Button`
- Rename unnecessary `Settings` prefix from components in `Settings/`

# Important Notes
None
2024-09-27 07:05:10 +00:00

83 lines
2.0 KiB
TypeScript

/** @file Test the setup flow. */
import * as test from '@playwright/test'
import { Plan } from 'enso-common/src/services/Backend'
import * as actions from './actions'
test.test('setup (free plan)', ({ page }) =>
actions
.mockAll({
page,
setupAPI: (api) => {
api.setCurrentUser(null)
},
})
.loginAsNewUser()
.setUsername('test user')
.stayOnFreePlan()
.goToPage.drive()
.withDriveView(async (drive) => {
await test.expect(drive).toBeVisible()
}),
)
test.test('setup (solo plan)', ({ page }) =>
actions
.mockAll({
page,
setupAPI: (api) => {
api.setCurrentUser(null)
},
})
.loginAsNewUser()
.setUsername('test user')
.selectSoloPlan()
.goToPage.drive()
.withDriveView(async (drive) => {
await test.expect(drive).toBeVisible()
}),
)
test.test('setup (team plan, skipping invites)', ({ page }) =>
actions
.mockAll({
page,
setupAPI: (api) => {
api.setCurrentUser(null)
},
})
.loginAsNewUser()
.setUsername('test user')
.selectTeamPlan(Plan.team)
.setOrganizationName('test organization')
.skipInvitingUsers()
.setTeamName('test team')
.goToPage.drive()
.withDriveView(async (drive) => {
await test.expect(drive).toBeVisible()
}),
)
test.test('setup (team plan)', ({ page }) =>
actions
.mockAll({
page,
setupAPI: (api) => {
api.setCurrentUser(null)
},
})
.loginAsNewUser()
.setUsername('test user')
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
.selectTeamPlan(Plan.team, 10)
.setOrganizationName('test organization')
.inviteUsers('foo@bar.baz bar@bar.baz, baz@example.com; other+email@org.co.uk')
.setTeamName('test team')
.goToPage.drive()
.withDriveView(async (drive) => {
await test.expect(drive).toBeVisible()
}),
)
// No test for enterprise plan as the plan must be set to enterprise manually.