Skip to content

Commit

Permalink
feat: add project tags for members
Browse files Browse the repository at this point in the history
  • Loading branch information
benfurber committed Nov 6, 2024
1 parent 1ea88f0 commit 69af43f
Show file tree
Hide file tree
Showing 13 changed files with 590 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface IProps {

export const ProfileTagsList = ({ tags }: IProps) => {
return (
<Flex sx={{ gap: 2, flexWrap: 'wrap' }}>
<Flex data-cy="ProfileTagsList" sx={{ gap: 2, flexWrap: 'wrap' }}>
{tags.map(
(tag, index) =>
tag?.label && (
Expand Down
2 changes: 1 addition & 1 deletion packages/cypress/src/integration/map.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ describe('[Map]', () => {
cy.get(`[data-cy=pin-${userId}]`).click()
cy.get('[data-cy=PinProfile]').within(() => {
cy.get('[data-cy=Username]').contains(userId)
cy.contains('Wants to get started')
cy.get('[data-cy=ProfileTagsList]').contains('Organise Meetups')
})
cy.url().should('include', `#${userId}`)

Expand Down
66 changes: 66 additions & 0 deletions packages/cypress/src/integration/settings.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ describe('[Settings]', () => {
const description = "I'm a very active member"
const mapPinDescription = 'Fun, vibrant and full of amazing people'
const profileType = 'member'
const tag = 'Sewing'
const user = generateNewUserDetails()
const url = 'https://social.network'

Expand Down Expand Up @@ -79,6 +80,7 @@ describe('[Settings]', () => {
country,
description,
})
cy.selectTag(tag, '[data-cy=tag-select]')
cy.get('[data-cy="country:BO"]')

cy.step('Errors if trying to upload invalid image')
Expand Down Expand Up @@ -242,6 +244,40 @@ describe('[Settings]', () => {
cy.visit('/sign-in')
})

it('Can create member', () => {
// Comprehensive member test above for FF,
// minimal spec here for PP specific functionality

const country = 'Bolivia'
const displayName = 'settings_member_new'
const description = "I'm a very active member"
const profileType = 'member'
const user = generateNewUserDetails()
const tag = 'Melting'

cy.signUpNewUser(user)
cy.get('[data-cy=complete-profile-button]').click()

cy.step('Can set the required fields')
cy.setSettingFocus(profileType)
cy.setSettingBasicUserInfo({
displayName,
country,
description,
})
cy.selectTag(tag, '[data-cy=tag-select]')
cy.setSettingAddContactLink({
index: 0,
label: ExternalLinkLabel.SOCIAL_MEDIA,
url: 'http://something.to.delete/',
})
cy.saveSettingsForm()

cy.step('Updated settings display on profile')
cy.visit(`u/${user.username}`)
cy.contains(tag)
})

it('Can create space', () => {
const coverImage = 'profile-cover-1-edited'
const userImage = 'avatar'
Expand Down Expand Up @@ -365,10 +401,40 @@ describe('[Settings]', () => {
})

it('[Member]', () => {
// Comprehensive member test above for FF,
// minimal spec here for PK specific functionality

cy.signUpNewUser()
cy.visit('/settings')
cy.contains('Infos')
cy.get('[data-cy=FocusSection]').should('not.exist')

const country = 'Bolivia'
const displayName = 'settings_member_new'
const description = "I'm a very active member"
const tag = 'Landscaping'
const user = generateNewUserDetails()

cy.signUpNewUser(user)
cy.get('[data-cy=complete-profile-button]').click()

cy.step('Can set the required fields')
cy.setSettingBasicUserInfo({
displayName,
country,
description,
})
cy.selectTag(tag, '[data-cy=tag-select]')
cy.setSettingAddContactLink({
index: 0,
label: ExternalLinkLabel.SOCIAL_MEDIA,
url: 'http://something.to.delete/',
})
cy.saveSettingsForm()

cy.step('Updated settings display on profile')
cy.visit(`u/${user.username}`)
cy.contains(tag)
})
})
})
Loading

0 comments on commit 69af43f

Please sign in to comment.