mirror of
https://github.com/PostHog/posthog.git
synced 2024-11-24 00:47:50 +01:00
feat: making role in organization as a required field (#26205)
Co-authored-by: Your Name (aider) <you@example.com>
This commit is contained in:
parent
fb4c5b6d86
commit
2b2e7e48b1
@ -77,6 +77,9 @@ describe('Signup', () => {
|
||||
cy.get('[data-attr=password]').type(VALID_PASSWORD).should('have.value', VALID_PASSWORD)
|
||||
cy.get('[data-attr=signup-start]').click()
|
||||
cy.get('[data-attr=signup-name]').type('Alice Bob').should('have.value', 'Alice Bob')
|
||||
cy.get('[data-attr=signup-role-at-organization]').click()
|
||||
cy.get('.Popover li:first-child').click()
|
||||
cy.get('[data-attr=signup-role-at-organization]').contains('Engineering')
|
||||
cy.get('[data-attr=signup-submit]').click()
|
||||
|
||||
cy.wait('@signupRequest').then((interception) => {
|
||||
@ -93,6 +96,9 @@ describe('Signup', () => {
|
||||
cy.get('[data-attr=password]').type(VALID_PASSWORD).should('have.value', VALID_PASSWORD)
|
||||
cy.get('[data-attr=signup-start]').click()
|
||||
cy.get('[data-attr=signup-name]').type('Alice Bob').should('have.value', 'Alice Bob')
|
||||
cy.get('[data-attr=signup-role-at-organization]').click()
|
||||
cy.get('.Popover li:first-child').click()
|
||||
cy.get('[data-attr=signup-role-at-organization]').contains('Engineering')
|
||||
cy.get('[data-attr=signup-submit]').click()
|
||||
|
||||
cy.wait('@signupRequest').then(() => {
|
||||
@ -105,6 +111,9 @@ describe('Signup', () => {
|
||||
const newEmail = `new_user+${Math.floor(Math.random() * 10000)}@posthog.com`
|
||||
cy.get('[data-attr=signup-email]').clear().type(newEmail).should('have.value', newEmail)
|
||||
cy.get('[data-attr=signup-start]').click()
|
||||
cy.get('[data-attr=signup-role-at-organization]').click()
|
||||
cy.get('.Popover li:first-child').click()
|
||||
cy.get('[data-attr=signup-role-at-organization]').contains('Engineering')
|
||||
cy.get('[data-attr=signup-submit]').click()
|
||||
|
||||
cy.wait('@signupRequest').then((interception) => {
|
||||
|
@ -3,7 +3,7 @@ import { LemonSelect } from 'lib/lemon-ui/LemonSelect'
|
||||
|
||||
export default function SignupRoleSelect({ className }: { className?: string }): JSX.Element {
|
||||
return (
|
||||
<LemonField name="role_at_organization" label="What is your role?" className={className} showOptional>
|
||||
<LemonField name="role_at_organization" label="What is your role?" className={className}>
|
||||
<LemonSelect
|
||||
fullWidth
|
||||
data-attr="signup-role-at-organization"
|
||||
|
@ -83,8 +83,9 @@ export const signupLogic = kea<signupLogicType>([
|
||||
role_at_organization: '',
|
||||
referral_source: '',
|
||||
} as SignupForm,
|
||||
errors: ({ name }) => ({
|
||||
errors: ({ name, role_at_organization }) => ({
|
||||
name: !name ? 'Please enter your name' : undefined,
|
||||
role_at_organization: !role_at_organization ? 'Please select your role in the organization' : undefined,
|
||||
}),
|
||||
submit: async (payload, breakpoint) => {
|
||||
breakpoint()
|
||||
|
Loading…
Reference in New Issue
Block a user