Skip to content

Commit

Permalink
#2490: validate that contact project button does not exist when email…
Browse files Browse the repository at this point in the history
… service is not enabled
  • Loading branch information
sudo-may committed Jun 10, 2024
1 parent 8165221 commit f509436
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ import { useSkillsDisplayThemeState } from '@/skills-display/stores/UseSkillsDis
import { useWindowSize } from '@vueuse/core'
import ResponsiveBreakpoints from '@/components/utils/misc/ResponsiveBreakpoints.js'
import ContactOwnersDialog from '@/components/myProgress/ContactOwnersDialog.vue'
import { useAppInfoState } from '@/stores/UseAppInfoState.js'
const route = useRoute()
const projectId = route.params.projectId
const skillsDisplayAttributes = useSkillsDisplayAttributesState()
const themeState = useSkillsDisplayThemeState()
const appInfo = useAppInfoState()
const windowSize = useWindowSize()
const currentWidth = ref(windowSize.width)
Expand Down Expand Up @@ -70,7 +72,7 @@ const handleProjInvitation = () => {

<template>
<div style="position: relative">
<div :class="{
<div v-if="appInfo.emailEnabled" :class="{
'contact-button-inline': isContactButtonInline,
'text-center': !isContactButtonInline
}">
Expand Down
9 changes: 9 additions & 0 deletions e2e-tests/cypress/e2e/my-progress_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,15 @@ describe('My Progress Tests', () => {
cy.get('[data-cy="contactProjectOwnerDialog"]').should('not.exist');
});

it('do not show contact project admins button if email service is diabled', () => {
cy.intercept('/public/isFeatureSupported?feature=emailservice', 'false').as('isEmailServiceSupported');
cy.visit('/progress-and-rankings/projects/proj1');
cy.wait('@isEmailServiceSupported')
cy.get('[data-cy="skillsDisplayHome"] [data-cy="pointHistoryChartWithData"]')
cy.wait(3000)
cy.get('[data-cy="contactOwnerBtn"]').should('not.exist');
})

it('Send email to project owner', () => {
cy.intercept('POST', '/api/projects/*/contact').as('contact');
cy.intercept('POST', '/api/validation/description*').as('validate');
Expand Down

0 comments on commit f509436

Please sign in to comment.