0
0
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:
Surbhi 2024-11-15 14:44:21 -04:00 committed by GitHub
parent fb4c5b6d86
commit 2b2e7e48b1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 12 additions and 2 deletions

View File

@ -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) => {

View File

@ -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"

View File

@ -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()